mvn deploy
명령을 내리면 된다.
URL은 직접 지정하거나 혹은 ${deploy.url}
형태의 프라퍼티로 지정하고, Maven 실행시 시스템 프라퍼티로 값을 주는 방법도 좋다.
<distributionManagement> <repository> <id>deployment</id> <name>Internal Releases</name> <url>http://your.server.com:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>deployment</id> <name>Internal Releases</name> <url>http://your.server.com:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
id
값의 서버에 인증(authentication)이 있을 경우에 ~/.m2/settings.xml
에 인증 정보를 넣어주어야 한다.<servers> <server> <id>deployment</id> <username>deployment</username> <password>deployment123</password> </server> </servers>
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
mvn source:jar javadoc:jar deploy