java - Running multiple maven build profiles serially -


i using maven assembly plugin build jar in project. i've got 2 profiles , each of them builds jar different main class. wanted know if there method of running both profiles serially. so, when run mvn install command, both jars in target.

this part of pom building jar different profiles:

    <profiles>     <profile>         <id>main</id>         <build>             <plugins>                 <plugin>                     <artifactid>maven-jar-plugin</artifactid>                     <version>2.3.1</version>                     <executions>                         <execution>                             <id>default-jar</id>                             <phase>none</phase>                         </execution>                     </executions>                 </plugin>                 <plugin>                     <groupid>org.apache.maven.plugins</groupid>                     <artifactid>maven-assembly-plugin</artifactid>                     <version>2.4.1</version>                     <executions>                         <execution>                             <id>make-assembly-1</id>                             <phase>package</phase>                             <goals>                                 <goal>single</goal>                             </goals>                             <configuration>                                 <finalname>event-distributor-main</finalname>                                 <descriptorrefs>                                     <descriptorref>jar-with-dependencies</descriptorref>                                 </descriptorrefs>                                 <archive>                                     <manifest>                                         <addclasspath>true</addclasspath>                                         <classpathprefix>lib/</classpathprefix>                                         <mainclass>com.adobe.highbeam.xenon.distributor.eventsdistributormain</mainclass>                                     </manifest>                                 </archive>                             </configuration>                         </execution>                     </executions>                 </plugin>                 <plugin>                     <groupid>org.apache.maven.plugins</groupid>                     <artifactid>maven-compiler-plugin</artifactid>                     <version>3.3</version>                     <configuration>                         <source>1.8</source>                         <target>1.8</target>                     </configuration>                 </plugin>             </plugins>         </build>     </profile>     <profile>         <id>retry</id>         <build>             <plugins>                 <plugin>                     <artifactid>maven-jar-plugin</artifactid>                     <version>2.3.1</version>                     <executions>                         <execution>                             <id>default-jar</id>                             <phase>none</phase>                         </execution>                     </executions>                 </plugin>                 <plugin>                     <groupid>org.apache.maven.plugins</groupid>                     <artifactid>maven-assembly-plugin</artifactid>                     <version>2.4.1</version>                     <executions>                         <execution>                             <id>make-assembly-1</id>                             <phase>package</phase>                             <goals>                                 <goal>single</goal>                             </goals>                             <configuration>                                 <finalname>event-distributor-retry</finalname>                                 <descriptorrefs>                                     <descriptorref>jar-with-dependencies</descriptorref>                                 </descriptorrefs>                                 <archive>                                     <manifest>                                         <addclasspath>true</addclasspath>                                         <classpathprefix>lib/</classpathprefix>                                         <mainclass>com.adobe.highbeam.xenon.distributor.eventsdistributorretry</mainclass>                                     </manifest>                                 </archive>                             </configuration>                         </execution>                     </executions>                 </plugin>                 <plugin>                     <groupid>org.apache.maven.plugins</groupid>                     <artifactid>maven-compiler-plugin</artifactid>                     <version>3.3</version>                     <configuration>                         <source>1.8</source>                         <target>1.8</target>                     </configuration>                 </plugin>             </plugins>         </build>     </profile> </profiles> 


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -