Web アプリケーションの依存 jar を構築するための 2 つのプロファイルがあります (1 つは tomcat 用で、もう 1 つは websphere 用です)。ここで私が試みているのは、これらの 2 つのプロファイルを一度に実行して、それらの jar を一緒に構築することです。
mvn help:active-profiles -o -Dmaven.test.skip=true clean install -PTOMCAT,WEBSPHERE
これらの実行の結果として、acme-tomcat-0.0.1-SNAPSHOT.jarとacme-web-0.0.1-SNAPSHOT.jarが期待されますが、これらとともにデフォルトの jar も作成されていますacme-0.0.1-SNAPSHOT .jar . これは、デフォルトの実行によるものと思われます。
デフォルトのacme-0.0.1-SNAPSHOT.jarの生成を避けるために、このデフォルトの実行をどのように回避できますか。これに到達するために、ここSOでいくつかのソリューションを参照しました。また、以前に同様の投稿を作成しましたが、このシナリオでは役に立ちません. どんなポインタも役に立ちます。
プロファイル構成は次のようになります
<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>
ありがとう、サン