Permalink
Browse files

Reworked war overlay to depends on ui in a profile

See #187 (and also #180)

War overlay plugin was depending on -ui.zip artifact, replaced by a profile to prevent build errors when, the ui artifact is nowhere to be found.
If you want to build the "final" artifact, you will need to run the package command with the "release" profile enabled :

    mvn package -Prelease

This will create a war file ending in -full.war containing your server logic as well as your ui.
This generated file exists to prevent name clashing between artifact with and without ui logic.
  • Loading branch information...
CedricGatay committed Apr 8, 2015
1 parent 88e1be3 commit 3421e31b2b856dc83e2906c813bb05f371c2a5bb
@@ -1,14 +1,54 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<overlays>
<overlay>
<groupId>${project.war.overlay.groupId}</groupId>
<artifactId>${project.war.overlay.artifactId}-ui</artifactId>
<type>zip</type>
</overlay>
</overlays>
</configuration>
</plugin>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warName>${project.war.overlay.artifactId}-full</warName>
<overlays>
<overlay>
<groupId>${project.war.overlay.groupId}</groupId>
<artifactId>${project.war.overlay.artifactId}-ui</artifactId>
<type>zip</type>
</overlay>
</overlays>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>attach-full-war</id>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}${file.separator}${project.war.overlay.artifactId}-full.war</file>
<type>war</type>
<classifier>full</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>${project.war.overlay.groupId}</groupId>
<artifactId>${project.war.overlay.artifactId}-ui</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
</dependencies>
</profile>
</profiles>
@@ -17,9 +17,6 @@
},
"dependencies": {
"compile": [
{{#useSrvuiLayout}}
"{{groupId}}:{{artifactId}}-ui:{{version}}:zip",
{{/useSrvuiLayout}}
"io.restx:restx-core:${restx.version}",
"io.restx:restx-security-basic:${restx.version}",
"io.restx:restx-core-annotation-processor:${restx.version}",

0 comments on commit 3421e31

Please sign in to comment.