AnsweredAssumed Answered

Facing problem when customizing Alfresco war with AMP file

Question asked by ssvvamsi on May 6, 2009
Latest reply on May 7, 2009 by openpj
I am using Alfresco-JBOSS (Alfresco Enterprise 2.0). When I am trying to build it with follwing Build.xml ,it is saying module.properties not found.

Exception in thread "main" org.alfresco.repo.module.tool.ModuleManagementToolException: No module.properties file has been found in the installing .amp file './build/dist/Basic.amp'
     [java]    at org.alfresco.repo.module.tool.ModuleManagementTool.installModule(ModuleManagementTool.java:243)
     [java]    at org.alfresco.repo.module.tool.ModuleManagementTool.main(ModuleManagementTool.java:775)
     [java] Java Result: 1



Build.xml

<!– 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/Basic.jar" />
<property name="amp.file" value="${build.dir}/dist/Basic.amp"/>
<property name="tomcat.dir" value="D:/Downloads/Dumps/alfresco-enterprise-jboss-2.0.0Preview" />
<property name="war.file" value="D:/Downloads/Dumps/alfresco-enterprise-jboss-2.0.0Preview/jboss/server/default/deploy/alfresco.war"/>
<property name="lib.dir" value="D:/Downloads/Alfresco-SDK/alfresco-community-sdk-2.1.0/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="compile">
           <mkdir dir="${build.dir}/classes" />
           <javac classpathref="class.path" srcdir="${project.dir}/source/java" destdir="${build.dir}/classes" />
       </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="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>

Outcomes