have two profiles to build a dependent jar for a web application (one for tomcat and the other is for websphere). Here what I'm trying is to run those two profiles in one go to build those jars together.
mvn help:active-profiles -o -Dmaven.test.skip=true clean install -PTOMCAT,WEBSPHERE
As a result of these executions we are expecting acme-tomcat-0.0.1-SNAPSHOT.jar and acme-web-0.0.1-SNAPSHOT.jar but along with these a default jar is also being created acme-0.0.1-SNAPSHOT.jar. It seems this because of the default execution.
How can we avoid this default execution to avoid the generation of default acme-0.0.1-SNAPSHOT.jar. We have referred a couple of solutions here in SO to arrive this and also we have made a similar post earlier but which will not help us in this scenario. Any pointers would be helpful.
Profile configuration looks like
<profiles>
<profile>
<id>TOMCAT</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>tom-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-tomcat-${project.version}</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jms-api</artifactId>
<version>1.1.0.GA</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>WEBSPHERE</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>web-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-web-${project.version}</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.4.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jms-api</artifactId>
<version>1.1.0.GA</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>
Thanks, San