s243a

Copy Jars into build folder (Maven)

Jun 2nd, 2015
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.27 KB | None | 0 0
  1. <!-- based on http://stackoverflow.com/questions/8706017/maven-dependency-plugin-goals-copy-dependencies-unpack-is-not-supported-b
  2. I added the following code to unpack depencies into the build director
  3. -->
  4.  
  5.     <plugin>
  6.                 <groupId>org.apache.maven.plugins</groupId>
  7.                 <artifactId>maven-dependency-plugin</artifactId>
  8.                 <version>2.8</version>
  9.                 <executions>
  10.                     <execution>
  11.                         <id>copy</id>
  12.                         <phase>package</phase>
  13.                         <goals>
  14.                             <goal>copy-dependencies</goal>
  15.                         </goals>
  16.                         <configuration>
  17.                             <outputDirectory>${project.build.directory}</outputDirectory>
  18.                         </configuration>
  19.                     </execution>
  20.                 </executions>
  21.             </plugin>
  22. <!-- this copied the jars into the directory called "target" directory (without unpacking them). These jars were then copied into the exported jar from eclipse under the folder called "target"
  23.  
  24. I also added the following code (from the same link) into the pom file which may or may have not been necessary for the above to work -->
  25.  
  26.    <plugin>
  27.         <groupId>org.eclipse.m2e</groupId>
  28.         <artifactId>lifecycle-mapping</artifactId>
  29.         <version>1.0.0</version>
  30.         <configuration>
  31.             <lifecycleMappingMetadata>
  32.                 <pluginExecutions>
  33.                     <!-- copy-dependency plugin -->
  34.                     <pluginExecution>
  35.                         <pluginExecutionFilter>
  36.                             <groupId>org.apache.maven.plugins</groupId>
  37.                             <artifactId>maven-dependency-plugin</artifactId>
  38.                             <versionRange>[1.0.0,)</versionRange>
  39.                             <goals>
  40.                                 <goal>copy-dependencies</goal>
  41.                             </goals>
  42.                         </pluginExecutionFilter>
  43.                         <action>
  44.                             <ignore />
  45.                         </action>
  46.                     </pluginExecution>
  47.                 </pluginExecutions>
  48.             </lifecycleMappingMetadata>
  49.         </configuration>
  50.     </plugin>
Advertisement
Add Comment
Please, Sign In to add comment