如何将JAR上传到Nexus OSS 3?
如何通过curl
Nexus 3执行jar上传? 我尝试使用link tips但没有成功。如何将JAR上传到Nexus OSS 3?
这里是我的尝试:
curl -v -F r = -F releases hasPom = true and = -F jar -F file = @./v12.1.0.1/pom.xml -F file = @./v12.1.0.1/ojdbc7.jar -u admin: admin123 http: // localhost: 8081/repository/maven releases
curl -v -F r = -F releases hasPom = false -F and -F jar = g = com.oracle.jdbc -F = ojdbc7 -F v = 1.0 p = -F jar -F file = @./v12 .1.0.1/ojdbc7.jar -u admin: admin123 http: // localhost: 8081/repository/maven releases
两个有400错误的请求。
我修改了你的代码,如下所示。请试试这个。
curl -v -F r=releases -F hasPom=false -F e=jar -F g=com.oracle.jdbc -F a=ojdbc7 -F v=1.0 -F p=jar -F [email protected]"./v12.1.0.1/ojdbc7.jar" -u admin:admin123 http://localhost:8081/nexus/service/local/artifact/maven/content
另外我会建议使用完整路径而不是相对路径。你能分享你使用这个卷曲片段的地方吗?任何CI工具像Jenkins?
目录的内容
cert_for_nexus.pem
curl.exe
的pom.xml
utils的-1.0.jar
的Nexus V3被配置用于HTTP
卷曲-v -u管理员:为admin123 --upload文件的pom.xml http://localhost:8081/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.pom
卷曲-v -u管理员:为admin123 --upload文件utils的-1.0.jar http://localhost:8081/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.jar
的Nexus V3配置为HTTPS
- 先决条件:必须有卷曲启用SSL(link - 左侧菜单)
卷曲-v --cacert cert_for_nexus.pem -u管理员:为admin123 --upload文件的pom.xml https://localhost:8443/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.pom
卷曲-v --cacert cert_for_nexus.pem -u管理员:为admin123 --upload文件utils的-1.0 pom.xml中的的.jar https://localhost:8443/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.jar
内容
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.foo</groupId>
<artifactId>utils</artifactId>
<version>1</version>
</project>
编辑:固定-u为了既HTTPS例子
这看起来是正确的 - 一个Sonatype人 – DarthHater
你可以使用nexus-cli。
docker run -ti -v $(pwd):$(pwd):ro sjeandeaux/nexus-cli:0.2.0 \
-repo=http://nexus:8081/repository/maven-releases \
-user=admin \
-password=admin123 \
-file=$(pwd)/upload.jar \
-groupID=your.group \
-artifactID=yourArtifactID \
-version=0.1.0 \
-hash md5 \
-hash sha1
为什么你的参数中有所有空格? –