Commit e45ca94d authored by Yann Mombrun's avatar Yann Mombrun

Move the specific build of a jar in a profile like before


Otherwise it tries to generate a jar for this pom project
parent 91c5eaad
......@@ -32,7 +32,6 @@
</properties>
<dependencies>
<!-- WebLabExchangeModel -->
<dependency>
......@@ -275,52 +274,66 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- only class files are included into jar files -->
<includes>
<include>**/*.class</include>
</includes>
<finalName>${project.artifactId}-${project.version}</finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${project.artifactId}-${project.version}.jar</file>
<type>jar</type>
<classifier>jar</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- specific profile that is used to package class files also in a jar during install phase of WEB projects (using jar classifier), to have a war + a jar at the end. Jar could then be used as dependency
in other projects, especially projects that need to override (or simply add) some code on to a webservice (customisation) -->
<profiles>
<profile>
<id>generate-jar</id>
<!-- this work will be done only if a src/main/webapp directory exist (not this parent pom for example) -->
<activation>
<file>
<exists>src/main/webapp</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- only class files are included into jar files -->
<includes>
<include>**/*.class</include>
</includes>
<finalName>${project.artifactId}-${project.version}</finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${project.artifactId}-${project.version}.jar</file>
<type>jar</type>
<classifier>jar</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment