Build maven jar from classes no java source -


i want build maven jar artifact classes. don't have source files. these classes in artifact installed locally. use maven-dependency-plugin unpack classes , put them in target folder project/module.

it creates jar.. doesn't include classes unpacked. here's pom:

<build> ...   <!-- unpack myjar1.jar , myjar2.jar -->             <plugin>                 <groupid>org.apache.maven.plugins</groupid>                 <artifactid>maven-dependency-plugin</artifactid>                 <version>2.8</version>                 <executions>                     <execution>                         <id>unpack</id>                         <phase>package</phase>                         <goals>                             <goal>unpack</goal>                         </goals>                         <configuration>                             <artifactitems>                                 <artifactitem>                                     <groupid>com.company</groupid>                                     <artifactid>myjar1</artifactid>                                     <version>1.0</version>                                     <type>jar</type>                                     <overwrite>false</overwrite>                                     <outputdirectory>target/final</outputdirectory>                                 </artifactitem>                                 <artifactitem>                                     <groupid>com.company</groupid>                                     <artifactid>myjar2</artifactid>                                     <version>1.0</version>                                     <type>jar</type>                                     <overwrite>false</overwrite>                                     <outputdirectory>target/final</outputdirectory>                                 </artifactitem>                             </artifactitems>                         </configuration>                     </execution>                 </executions>             </plugin>  <plugin>                 <groupid>org.apache.maven.plugins</groupid>                 <artifactid>maven-jar-plugin</artifactid>                 <version>2.4</version>                 <executions>                     <execution>                         <id>default</id>                         <phase>package</phase>                         <goals>                             <goal>jar</goal>                         </goals>                         <configuration>                             <classesdirectory>/path/to/target/final/folder</classesdirectory>                             <includes>                                 <include>**</include>                             </includes>                         </configuration>                     </execution>                 </executions>             </plugin>  </plugins>  </build> 

how can include these classes final.jar?

i think best solution maven-shade-plugin: create pom.xml, add 2 libraries dependencies , configure maven-shade-plugin. run mvn package , have merged project.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -