Maven在项目中的应用

http://192.168.0.253:8081/nexus/#view-repositories;thirdparty~uploadPanel 使用局域网搭建的环境,输入用户名和密码登录,上传jar文件。

GAV Definition: GAV Parameters
Auto Guess: 是
Group: jar包根路径
Artifact: jar文件名
Version: jar版本号
Packaging: jar

上传成功后返回:

<dependency>

  <groupId>chinapay</groupId>

  <artifactId>netpayclient</artifactId>

  <version>1.0</version>

</dependency>

<dependency>

  <groupId>org.jsoup</groupId>

  <artifactId>jsoup</artifactId>

  <version>1.8.1</version>

</dependency>

 

1.Eclipse设置:

Preferences ->Maven ->Installations
Preferences ->Maven ->User Settings
Global Settings: D:\apache-maven-3.2.3\conf\settings.xml
User Settings: C:\Users\hj\.m2\settings.xml
Local Repository: C:\Users\hj\.m2\repository

 

2.设置环境变量:

MAVEN_HOME=D:\apache-maven-3.2.3
Path=%MAVEN_HOME%\bin;

 

3.配置settings.xml文件:

<localRepository>C:\Users\hj\.m2\repository</localRepository>

--C:\Users\hj\.m2\settings.xml--

--D:\apache-maven-3.2.3\conf\settings.xml--

 

4.重新获取Maven仓库文件:maven命令,定位到项目pom.xml物理路径执行。
E:\workspace\auto_0123_0304>mvn -v
E:\workspace\auto_0123_0304>mvn clean
E:\workspace\auto_0123_0304>mvn install -Dmaven.test.skip=true -P test package

 

你可能感兴趣的:(maven)