How to Generate WAR file in SDK 4.1?

cancel
Showing results for 
Search instead for 
Did you mean: 
jigir_shah
Active Member

How to Generate WAR file in SDK 4.1?

Jump to solution

Hello Everyone,

As I know, Alfresco SDK 4.1 generates Jar file on build. We can configure it for AMP file as well. However, for my deployment, I would need WAR file to be generated for my custom code.

Can anyone please let me know how can I achieve this? What are the steps needed in SDK?

 

Thanks in Advance.

1 Solution

Accepted Solutions
abhinavmishra14
Advanced

Re: How to Generate WAR file in SDK 4.1?

Jump to solution

SDK 4.x doesn't generate war files. Even previous version of sdk 3.x also does't generate war files as far as i know. However with sdk3.x you had option to create overlay project and build a custom war file by adding your customization to alfresco/share war files.

SDK4.x is totally based on docker,  so it is recommended to use its capabilities meant for docker based environment. 

All your customizations are automatically applied to base alfresco/share docker images and containers are launched. 

Even if you are planning to use standlone instances (installed via distribution method), you can opt 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: https://docs.alfresco.com/6.2/concepts/dev-extensions-packaging-techniques-amps.html if your customzations are in form of amp package. 

Have a look at these docs:

https://docs.alfresco.com/6.2/concepts/deploy-concepts.html

https://docs.alfresco.com/6.2/concepts/deploy-prereqs.html

 

If you are still looking for generating war files, you may give a try by creating overlayed war with your custom modules by using "content-services-community" artifact for community and "content-services" artifact for enterprise versions of ACS. And for share you can use "share" artifact. See the dependencies below.

<!-- ACS war artifact for community version -->

<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>content-services-community</artifactId>
  <version>6.2.0-ga</version>
  <type>war</type>
</dependency>

<!-- ACS war artifact for enterprise version -->
<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>content-services</artifactId>
  <version>6.2.1</version>
  <type>war</type>
</dependency>

<!-- share war artifact for both community and enterprise versions -->
<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>share</artifactId>
  <version>6.2.1</version>
  <type>war</type>
</dependency>

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

2 Replies
akreienbring
Active Member

Re: How to Generate WAR file in SDK 4.1?

Jump to solution

I guess this is more a Maven question than a SDK question.

 

I haven't tried, but have a look at this maven plugin.

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.maven.war.plugin}</version>
</plugin>
<plugin>

If you integrate it into your build process you should be able to achieve what you want.

abhinavmishra14
Advanced

Re: How to Generate WAR file in SDK 4.1?

Jump to solution

SDK 4.x doesn't generate war files. Even previous version of sdk 3.x also does't generate war files as far as i know. However with sdk3.x you had option to create overlay project and build a custom war file by adding your customization to alfresco/share war files.

SDK4.x is totally based on docker,  so it is recommended to use its capabilities meant for docker based environment. 

All your customizations are automatically applied to base alfresco/share docker images and containers are launched. 

Even if you are planning to use standlone instances (installed via distribution method), you can opt 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: https://docs.alfresco.com/6.2/concepts/dev-extensions-packaging-techniques-amps.html if your customzations are in form of amp package. 

Have a look at these docs:

https://docs.alfresco.com/6.2/concepts/deploy-concepts.html

https://docs.alfresco.com/6.2/concepts/deploy-prereqs.html

 

If you are still looking for generating war files, you may give a try by creating overlayed war with your custom modules by using "content-services-community" artifact for community and "content-services" artifact for enterprise versions of ACS. And for share you can use "share" artifact. See the dependencies below.

<!-- ACS war artifact for community version -->

<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>content-services-community</artifactId>
  <version>6.2.0-ga</version>
  <type>war</type>
</dependency>

<!-- ACS war artifact for enterprise version -->
<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>content-services</artifactId>
  <version>6.2.1</version>
  <type>war</type>
</dependency>

<!-- share war artifact for both community and enterprise versions -->
<dependency>
  <groupId>org.alfresco</groupId>
  <artifactId>share</artifactId>
  <version>6.2.1</version>
  <type>war</type>
</dependency>

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)