jira-importer commented on issue #313: URL: https://github.com/apache/maven-install-plugin/issues/313#issuecomment-2771867476
**[Andreas Höhmann](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=hoehmi)** commented ``` <profile> <id>ca01</id> <build> <pluginManagement> <plugins> <!-- Override version for maven-install-plugin because there is a bug in 3.0.0-M1 preventing installing of ca01-war's --> <!-- See: https://issues.apache.org/jira/browse/MINSTALL-151 --> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <!-- Override version for maven-deploy-plugin because there is a similar bug in 3.0.0-M1 like the install-plugin --> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <excludes> <exlude>logback.xml</exlude> <exlude>**/.gitignore</exlude> <exlude>.gitignore</exlude> </excludes> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <classifier>ca01</classifier> <archiveClasses>true</archiveClasses> <attachClasses>true</attachClasses> <classesClassifier>ca01-classes</classesClassifier> <webResources> <resource> <directory>${project.build.directory}</directory> <includes> <include>jetty-env.xml</include> </includes> <targetPath>WEB-INF</targetPath> </resource> </webResources> <packagingExcludes> WEB-INF/classes, WEB-INF/lib/commons-logging*.jar, WEB-INF/lib/log4j*.jar, WEB-INF/lib/jcl-over-slf4j*, WEB-INF/lib/jul-to-slf4j*.jar, WEB-INF/lib/slf4j*.jar, WEB-INF/lib/logback*.jar, WEB-INF/lib/el-impl*.jar, WEB-INF/jetty-web.xml, WEB-INF/.faces-config.xml.jsfdia, **/.gitignore </packagingExcludes> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> <id>add-ca01-source</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>${basedir}/src/main/ca01/java/</source> </sources> </configuration> </execution> <execution> <id>add-ca01-resources</id> <phase>generate-resources</phase> <goals> <goal>add-resource</goal> </goals> <configuration> <resources> <resource> <directory>${basedir}/src/main/ca01/resources/</directory> </resource> </resources> </configuration> </execution> <execution> <id>add-ca01-test-source</id> <phase>generate-test-sources</phase> <goals> <goal>add-test-source</goal> </goals> <configuration> <sources> <source>${basedir}/src/test/ca01/java/</source> </sources> </configuration> </execution> <execution> <id>add-ca01-test-resources</id> <phase>generate-test-resources</phase> <goals> <goal>add-test-resource</goal> </goals> <configuration> <resources> <resource> <directory>${basedir}/src/test/ca01/resources/</directory> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> ``` With that we are able to build the same web-application in 2 different "flavors" - online version - and "ca01 version" -> a kind of offline version (?) how should I configure install/deploy to archive the same results as with the "old" maven plugins? Here is what I run ... ``` $ mvn clean install -nsu -DskipTests -Pca01 [INFO] [INFO] --- maven-jar-plugin:3.1.1:test-jar (default) @ cad-webservice --- [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-tests.jar [INFO] [INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ cad-webservice --- [INFO] Tests are skipped. [INFO] [INFO] --- git-commit-id-plugin:2.2.6:revision (default) @ cad-webservice --- [INFO] [INFO] --- maven-war-plugin:3.2.2:war (default-war) @ cad-webservice --- [INFO] Packaging webapp [INFO] Assembling webapp [cad-webservice] in [D:\Dev\git\coc\goos\cad-webservice\target\spicecad] [INFO] Processing war project [INFO] Copying webapp webResources [D:\Dev\git\coc\goos\cad-webservice\target] to [D:\Dev\git\coc\goos\cad-webservice\target\spicecad] [INFO] Copying webapp resources [D:\Dev\git\coc\goos\cad-webservice\src\main\webapp] [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad\WEB-INF\lib\cad-webservice-2.2019.02.0-SNAPSHOT.jar [INFO] Webapp assembled in [2106 msecs] [INFO] Building war: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-ca01.war [INFO] [INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @ cad-webservice --- [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-sources.jar [INFO] [INFO] --- maven-source-plugin:3.0.1:test-jar-no-fork (attach-sources) @ cad-webservice --- [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-test-sources.jar [INFO] [INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @ cad-webservice --- [INFO] Skipping javadoc generation [INFO] [INFO] --- maven-javadoc-plugin:3.0.1:test-jar (attach-javadocs) @ cad-webservice --- [INFO] Skipping javadoc generation [INFO] [INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ cad-webservice --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 43.496 s [INFO] Finished at: 2019-01-11T09:45:25+01:00 [INFO] Final Memory: 93M/1238M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install) on project cad-webservice: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1] $ ls -la target/ total 93960 drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:45 classes/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:44 generated-sources/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:45 generated-test-sources/ -rw-r--r-- 1 hoehmann 1049089 7927 Jan 11 09:44 jetty-env.xml drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:45 maven-archiver/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:45 spicecad/ -rw-r--r-- 1 hoehmann 1049089 94863803 Jan 11 09:45 spicecad-ca01.war -rw-r--r-- 1 hoehmann 1049089 251161 Jan 11 09:45 spicecad-classes.jar -rw-r--r-- 1 hoehmann 1049089 161729 Jan 11 09:45 spicecad-sources.jar -rw-r--r-- 1 hoehmann 1049089 473024 Jan 11 09:45 spicecad-tests.jar -rw-r--r-- 1 hoehmann 1049089 431800 Jan 11 09:45 spicecad-test-sources.jar drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:45 test-classes/ -rw-r--r-- 1 hoehmann 1049089 5057 Jan 11 09:44 tomcat-context.xml ``` And here the "normal" build which works: ``` $mvn clean install -nsu -DskipTests [INFO] [INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ cad-webservice --- [INFO] Tests are skipped. [INFO] [INFO] --- git-commit-id-plugin:2.2.6:revision (default) @ cad-webservice --- [INFO] [INFO] --- maven-war-plugin:3.2.2:war (default-war) @ cad-webservice --- [INFO] Packaging webapp [INFO] Assembling webapp [cad-webservice] in [D:\Dev\git\coc\goos\cad-webservice\target\spicecad] [INFO] Processing war project [INFO] Copying webapp resources [D:\Dev\git\coc\goos\cad-webservice\src\main\webapp] [INFO] Webapp assembled in [1536 msecs] [INFO] Building war: D:\Dev\git\coc\goos\cad-webservice\target\spicecad.war [INFO] [INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @ cad-webservice --- [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-sources.jar [INFO] [INFO] --- maven-source-plugin:3.0.1:test-jar-no-fork (attach-sources) @ cad-webservice --- [INFO] Building jar: D:\Dev\git\coc\goos\cad-webservice\target\spicecad-test-sources.jar [INFO] [INFO] --- maven-javadoc-plugin:3.0.1:jar (attach-javadocs) @ cad-webservice --- [INFO] Skipping javadoc generation [INFO] [INFO] --- maven-javadoc-plugin:3.0.1:test-jar (attach-javadocs) @ cad-webservice --- [INFO] Skipping javadoc generation [INFO] [INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ cad-webservice --- [INFO] Installing D:\Dev\git\coc\goos\cad-webservice\target\spicecad.war to D:\Dev\ApacheMaven\repository\com\siemens\spice\cad-webservice\2.2019.02.0-SNAPSHOT\cad-webservice-2.2019.02.0-SNAPSHOT.war [INFO] Installing D:\Dev\git\coc\goos\cad-webservice\pom.xml to D:\Dev\ApacheMaven\repository\com\siemens\spice\cad-webservice\2.2019.02.0-SNAPSHOT\cad-webservice-2.2019.02.0-SNAPSHOT.pom [INFO] Installing D:\Dev\git\coc\goos\cad-webservice\target\spicecad-sources.jar to D:\Dev\ApacheMaven\repository\com\siemens\spice\cad-webservice\2.2019.02.0-SNAPSHOT\cad-webservice-2.2019.02.0-SNAPSHOT-sources.jar [INFO] Installing D:\Dev\git\coc\goos\cad-webservice\target\spicecad-test-sources.jar to D:\Dev\ApacheMaven\repository\com\siemens\spice\cad-webservice\2.2019.02.0-SNAPSHOT\cad-webservice-2.2019.02.0-SNAPSHOT-test-sources.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.407 s [INFO] Finished at: 2019-01-11T09:48:40+01:00 [INFO] Final Memory: 94M/1394M [INFO] ------------------------------------------------------------------------ $ ls -la target/ total 93996 drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 classes/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 generated-sources/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 generated-test-sources/ -rw-r--r-- 1 hoehmann 1049089 8100 Jan 11 09:48 jetty-env.xml drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 maven-archiver/ drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 spicecad/ -rw-r--r-- 1 hoehmann 1049089 95631598 Jan 11 09:48 spicecad.war -rw-r--r-- 1 hoehmann 1049089 161729 Jan 11 09:48 spicecad-sources.jar -rw-r--r-- 1 hoehmann 1049089 431800 Jan 11 09:48 spicecad-test-sources.jar drwxr-xr-x 1 hoehmann 1049089 0 Jan 11 09:48 test-classes/ -rw-r--r-- 1 hoehmann 1049089 5225 Jan 11 09:48 tomcat-context.xml ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org