04-15-2015 10:28 AM
<?xml version="1.0"?>
<project name="AMP Test2" default="package-amp" basedir=".">
<property name="project.dir" value="."/>
<property name="build.dir" value="${project.dir}/build"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="jar.file" value="${build.dir}/lib/temp2.jar"/>
<property name="amp.file" value="${build.dir}/dist/temp2.amp"/>
<target name="mkdirs">
<mkdir dir="${build.dir}/dist" />
<mkdir dir="${build.dir}/lib" />
</target>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="../../lib/server" includes="**/*.jar"/>
</path>
<target name="compile">
<mkdir dir="${build.dir}/classes" />
<javac classpathref="class.path" srcdir="${project.dir}/src/java" destdir="${build.dir}/classes" />
</target>
<target name="package-jar" depends="compile">
<jar destfile="${jar.file}" >
<fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" includes="**/*.class" />
</jar>
</target>
<target name="package-amp" depends="mkdirs, package-jar" description="Package the Module" >
<zip destfile="${amp.file}" >
<fileset dir="${project.dir}/build" includes="lib/*.jar" />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
<!–
<fileset dir="${project.dir}/config/alfresco/module/sdkDemoAmp" includes="module.properties" />
–>
</zip>
</target>
<target name="update-war" depends="package-amp" description="Update the WAR file. Set -Dwar.file=…" >
<echo>Installing SDK Demo AMP into WAR</echo>
<java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool">
<classpath refid="class.path" />
<arg line="install ${amp.file} ${war.file} -force -verbose"/>
</java>
</target>
</project>
Warning: skipping jar archive D:\WSEclipse\Alfresco\Alfresco_temp2\build\lib\temp2.jar because no files were included.
"Exception in thread "main" java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassPromJar<Unknow Source>
at sun.launcher.LauncherHelper.checkAndLoadMain<Unknow Source>"
04-16-2015 07:23 AM
04-21-2015 03:10 AM
<?xml version="1.0"?>
<project name="testing" default="deploy-war" basedir=".">
<!– Project directories, REPLACE WITH YOUR SETTINGS –>
<property name="project.dir" value="." />
<property name="build.dir" value="${project.dir}/build" />
<property name="jar.file" value="${build.dir}/lib/testing1.jar" />
<property name="amp.file" value="${build.dir}/dist/testing1.amp" />
<property name="tomcat.dir" value="D:\\Alfresco_temp2\\tomcat\" />
<property name="war.file" value="${tomcat.dir}/webapps/alfresco.war" />
<property name="lib.dir" value="D:\\Alfresco_SDK\\SDK3\\lib\\server" />
<!– Path to essential libraries –>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<!– Creates a build directory where the amp and jar files will be located –>
<target name="mkdirs">
<mkdir dir="${build.dir}/dist" />
<mkdir dir="${build.dir}/lib" />
</target>
<!–<target name="package-jar" depends="compile">–>
<target name="compile">
<mkdir dir="${build.dir}/classes" />
<javac classpathref="class.path" srcdir="${project.dir}/source" destdir="${build.dir}/classes" debug="true" debuglevel="lines,vars,source" />
</target>
<target name="package-jar" depends="compile">
<delete file="${jar.file}" />
<jar destfile="${jar.file}">
<fileset dir="${build.dir}" includes="**/faces-config.xml, **/*.class" />
</jar>
</target>
<target name="package-amp" depends="mkdirs, package-jar" description="Packages the amp">
<zip destfile="${amp.file}">
<fileset dir="${project.dir}/build" includes="lib/*.jar" />
<fileset dir="${project.dir}" includes="module.properties" />
<fileset dir="${project.dir}" includes="somecoactions.properties" />
<fileset dir="${project.dir}" includes="config/**/*.*" />
</zip>
</target>
<!– Use when checking what deployment of an AMP will do without actually committing the deployment –>
<target name="preview-install">
<echo>Preview installation of AMP</echo>
<java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool">
<classpath refid="class.path" />
<arg line="install ${amp.file} ${war.file} -preview -force -verbose" />
</java>
</target>
<!– Deploys the war to Alfresco –>
<target name="deploy-war" depends="package-amp">
<java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool">
<classpath refid="class.path" />
<arg line="install ${amp.file} ${war.file} -force -verbose" />
</java>
</target>
</project>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.