As the title, I tried generating war files from sdk 4 project of ours. But I couldn't get to it. Looks like we can only get amp or jar.
we have a standalone machine where we setup acs 6 standalone and we have to deploy war files to the standlone server.
can you help ?
Solved! Go to Solution.
By default SDK4 won't generate war files as far as i know.
There is a discussion around this here: https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-generate-war-file-in-sdk-4-1/m-p/...
Since you are using standlone instances, you can choose to deploy your customization jar files under "module/share", "module/platform" as stated here: https://docs.alfresco.com/6.2/concepts/dev-extensions-packaging-techniques-jar-files.html
or use alfresco mmt tool to apply amps if your customzations are in form of amp package.
It is also possible to generate war files but requires some additonal changes to the maven project, its not available default. You can create two sub projects one for alfresco and one for share for overlaying the war files with your customizations. Include the war artifact dependency in the subprojects for acs and share respectively.
In both sub projects you need to include maven-war-plugin. For example in acs subproject:
<dependencies> <!-- Get the original Alfresco Repo WAR artifact --> <dependency> <groupId>org.alfresco</groupId> <artifactId>content-services-community</artifactId> <version>6.2.0-ga</version> <type>war</type> </dependency> <!-- Include custom modules as dependencies -->
... </dependencies> <build> <finalName>alfresco</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource> <targetPath>WEB-INF/classes/alfresco</targetPath> <directory>src/main/webapp/alfresco</directory> <filtering>false</filtering> </resource> </webResources> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <configuration> <includes>com.github.abhinavmishra14*</includes> <excludes></excludes> <outputType>dot</outputType> </configuration> <executions> <execution> <id>unpack-amps</id> <phase>process-resources</phase> <goals> <goal>unpack-dependencies</goal> </goals> <configuration> <includeTypes>amp</includeTypes> <outputDirectory>${project.build.directory}/alfresco</outputDirectory> <excludes>META*</excludes> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.alfresco.maven.plugin</groupId> <artifactId>maven-amp-plugin</artifactId> <version>3.0.4</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.alfresco.maven.plugin</groupId> <artifactId>alfresco-maven-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <phase>none</phase> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-archiver</artifactId> <version>3.0</version> <executions> <execution> <phase>none</phase> </execution> </executions> </plugin> </plugins> </build>
Lastly, make sure you have allocated enough heap space for maven to build war files. Generally '1024m' works. See the additional info here: https://hub.alfresco.com/t5/alfresco-content-services-forum/im-having-trouble-assembling-war/td-p/29...
By default SDK4 won't generate war files as far as i know.
There is a discussion around this here: https://hub.alfresco.com/t5/alfresco-content-services-forum/how-to-generate-war-file-in-sdk-4-1/m-p/...
Since you are using standlone instances, you can choose to deploy your customization jar files under "module/share", "module/platform" as stated here: https://docs.alfresco.com/6.2/concepts/dev-extensions-packaging-techniques-jar-files.html
or use alfresco mmt tool to apply amps if your customzations are in form of amp package.
It is also possible to generate war files but requires some additonal changes to the maven project, its not available default. You can create two sub projects one for alfresco and one for share for overlaying the war files with your customizations. Include the war artifact dependency in the subprojects for acs and share respectively.
In both sub projects you need to include maven-war-plugin. For example in acs subproject:
<dependencies> <!-- Get the original Alfresco Repo WAR artifact --> <dependency> <groupId>org.alfresco</groupId> <artifactId>content-services-community</artifactId> <version>6.2.0-ga</version> <type>war</type> </dependency> <!-- Include custom modules as dependencies -->
... </dependencies> <build> <finalName>alfresco</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource> <targetPath>WEB-INF/classes/alfresco</targetPath> <directory>src/main/webapp/alfresco</directory> <filtering>false</filtering> </resource> </webResources> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> <configuration> <includes>com.github.abhinavmishra14*</includes> <excludes></excludes> <outputType>dot</outputType> </configuration> <executions> <execution> <id>unpack-amps</id> <phase>process-resources</phase> <goals> <goal>unpack-dependencies</goal> </goals> <configuration> <includeTypes>amp</includeTypes> <outputDirectory>${project.build.directory}/alfresco</outputDirectory> <excludes>META*</excludes> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>org.alfresco.maven.plugin</groupId> <artifactId>maven-amp-plugin</artifactId> <version>3.0.4</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.alfresco.maven.plugin</groupId> <artifactId>alfresco-maven-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <phase>none</phase> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-archiver</artifactId> <version>3.0</version> <executions> <execution> <phase>none</phase> </execution> </executions> </plugin> </plugins> </build>
Lastly, make sure you have allocated enough heap space for maven to build war files. Generally '1024m' works. See the additional info here: https://hub.alfresco.com/t5/alfresco-content-services-forum/im-having-trouble-assembling-war/td-p/29...
Worked!! Thnx for hint
Hi @venur
Thanks for accepting the solution - helpful to other uses to see what worked.
Cheers,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.