maven2私服artifatory中导入jar包

maven2私服artifatory中导入jar包

配置启动了artifactory后,
可以访问如下管理页面

http://192.168.10.253:8081/artifactory/

默认的用户名和密码 用户名:admin 密码:password

我在项目中导入oracle9.0的驱动,pom.xml如下:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>classes12</artifactId>
<version>9.0.2.0.0</version>
</dependency>

执行
mvn clean dependency:copy-dependencies
后报错如下:

Downloading: http://192.168.10.253:8081/artifactory/repo/com/oracle/classes12/9
.2.0.2.0/classes12-9.2.0.2.0.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.oracle:classes12:jar:9.2.0.2.0

Try downloading the file manually from:
      http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
Then, install it using the command:
      mvn install:install-file -DgroupId=com.oracle -DartifactId=classes12 -Dver
sion=9.2.0.2.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=classes12 -Dversi
on=9.2.0.2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[i
d]
Path to dependency:
        1) com.megaeyes:Mail2Jms2:war:0.0.1-SNAPSHOT
        2) com.oracle:classes12:jar:9.2.0.2.0
----------
1 required artifact is missing.
for artifact:
com.megaeyes:Mail2Jms2:war:0.0.1-SNAPSHOT
from the specified remote repositories:
snapshots (http://192.168.10.253:8081/artifactory/repo),
central (http://192.168.10.253:8081/artifactory/repo)

整个过程是,本地没有jar包,去MAVEN私服上下载,私服上没有,再去MAVEN官服下载
提示内容显示,maven的官服上没有oracle9的启动jar,需要手工下载。

所以我手工下载了classes12.jar这个oracle的驱动

在到私服的管理页面,想手工将这个驱动导入到我的MAVEN2私服里面

登陆http://192.168.10.253:8081/artifactory/后,选择菜单
Artifacts----->Deploy Artifacts
浏览选择jar包后,点击upload上传
上传后,会出现如下页面让你填写选择:
GroupId :     com.oracle
ArtifactId:   classes12
Version:   9.0.2.0.0
Classifier:       (不填)
Packaging:   jar
Use Jar POM/Generate default POM:
    (选中)
Target local repository:
    ext-releases-local

其实我主要是按照pom.xml的配置填写的
<dependency>
<groupId>com.oracle</groupId>
<artifactId>classes12</artifactId>
<version>9.0.2.0.0</version>
</dependency>

然后点击Deploy发布就行了

这个时候点开菜单
Repositories -----> Physical Repositories
在展开的菜单
ext-releases-local中就可以看到我们新加的jar包了

再在项目中执行mvn clean dependency:copy-dependencies
就可以从私服中下载得到这个jar包了。就不会再报错啦。



你可能感兴趣的:(oracle,maven,ext,配置管理,项目管理)