java deploy打包sdk上传
需要注意设置二部分maven中settings.xml 和项目中pom文件。
一、maven中settings.xml文件
<servers> <server> <id>snapshots</id> <username>yanbo.li</username> <password>xxx</password> </server> <server> <id>releases</id> <username>yanbo.li</username> <password>xxx?</password> </server> </servers>
二、配置项目pom文件
// 注意该部分<id>名称要与 settings.xml文件server中<id>相同 <distributionManagement> <repository> <id>releases</id> <name>releases</name> <url>http://nexus.dmall-os.cn:8081/nexus/repository/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>snapshots</name> <url>http://nexus.dmall-os.cn:8081/nexus/repository/snapshots/</url> </snapshotRepository> </distributionManagement>
编译打包插件也是在pom文件中
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.1</version> </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> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build>