一、准备Maven私服Nexus
添加saas.maven
仓库地址:http://192.168.31.109:8081/repository/saas.maven
二、新建SpringBoot项目com.saas.pdf
添加类:PdfUtil.java
package com.saas.pdf;
public class PdfUtil {
public static void Save(String filePath) {
System.out.println("保存成功!");
}
}
添加类:Main.java
package com.saas.pdf;
public class Main {
public static void main(String[] args){
}
}
执行打包:
上传:
二、配置maven私服务地址
修改:C:\Program Files\Java\apache-maven-3.6.3\apache-maven-3.6.3\conf\settings.xml
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://192.168.31.109:8081/repository/saas.maven</url>
</mirror>
添加项目 com.saas.swaggerdemo 引用依赖:
修改pom.xml
<dependencies>
<dependency>
<groupId>com.saas</groupId>
<artifactId>pdf</artifactId>
<version>0.0.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>saas</id>
<name>saas</name>
<url>http://192.168.31.109:8081/repository/saas.maven</url>
</repository>
</repositories>