2013년 8월 5일 월요일

Maven - Packaging Jar With Dependency

http://stackoverflow.com/questions/1729054/including-dependencies-in-a-jar-with-maven

위의 링크에서 알려준 방법으로 만들 수 있었다.
추가로 나는 pom.xml 파일에 아래의 내용을 추가했다.
그리고 maven에서 mvn package 명령을 실행했다.
(이클립스에서 goal을 package로 설정 후 실행)

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
 <executions>
   <execution>
          <id>make-assembly</id> <!-- this is used for inheritance merges -->
          <phase>package</phase> <!-- bind to the packaging phase -->
     <goals>
          <goal>attached</goal>
     </goals>
   </execution>
 </executions>
 <configuration>
       <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
       </descriptorRefs>
   </configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>

참고:http://mkkbest.tistory.com/entry/11-1
http://valley.egloos.com/viewer/?url=http://entireboy.egloos.com/4615383

댓글 없음:

댓글 쓰기