Artifactory 如何使用RESTAPI部署具有maven布局的工件?

Artifactory 如何使用RESTAPI部署具有maven布局的工件?,artifactory,Artifactory,我可以使用下面的命令进行正常部署 curl -i -X PUT -u $artifactoryUser:$artifactoryPassword -T /path/to/file/file.zip http://localhost/artifactory/simple/repo/groupId/artifactId/version/file.zip 但是,这不会解析或更新工件上的maven布局。有没有一种不使用artifactory maven插件就可以上传的方法?我找到了一个解决我发布的这个

我可以使用下面的命令进行正常部署

curl -i -X PUT -u $artifactoryUser:$artifactoryPassword -T /path/to/file/file.zip http://localhost/artifactory/simple/repo/groupId/artifactId/version/file.zip

但是,这不会解析或更新工件上的maven布局。有没有一种不使用artifactory maven插件就可以上传的方法?

我找到了一个解决我发布的这个问题的方法

使用的语法:

curl -i -X PUT -K $CURLPWD "http://localhost/artifactory/$REPO/$groupId/$artifactId/$versionId/$artifactId-$versionId.$fileExt"
最后编写了一个脚本,以便将md5和sha1值与文件一起上载,否则,我必须进入Artifactory并手动修复它

#!/bin/bash

usage() {
        echo "Please check the Usage of the Script, there were no enough parameters supplied."
        echo "Usage: ArtifactoryUpload.sh localFilePath Repo GroupID ArtifactID VersionID"
        exit 1
}

if [ -z "$5" ]; then
        usage
fi

localFilePath="$1"
REPO="$2"
groupId="$3"
artifactId="$4"
versionId="$5"

ARTIFAC=http://localhost/artifactory

if [ ! -f "$localFilePath" ]; then
        echo "ERROR: local file $localFilePath does not exists!"
        exit 1
fi

which md5sum || exit $?
which sha1sum || exit $?

md5Value="`md5sum "$localFilePath"`"
md5Value="${md5Value:0:32}"

sha1Value="`sha1sum "$localFilePath"`"
sha1Value="${sha1Value:0:40}"

fileName="`basename "$localFilePath"`"
fileExt="${fileName##*.}"

echo $md5Value $sha1Value $localFilePath
echo "INFO: Uploading $localFilePath to $targetFolder/$fileName"

curl -i -X PUT -K $CURLPWD \
-H "X-Checksum-Md5: $md5Value" \
-H "X-Checksum-Sha1: $sha1Value" \
-T "$localFilePath" \
"$ARTIFAC/$REPO/$groupId/$artifactId/$versionId/$artifactId-$versionId.$fileExt"

“不解析或更新maven布局”是什么意思?这不是为maven或任何其他构建工具创建“依赖项声明”。我也更新了这个问题。你的意思是你没有在UI中看到这个片段?你能发布一个截图吗?你能发布你使用的实际路径吗?如果您使用了有效的Maven布局,您应该会看到dependency decelerationI,我理解它非常古老,但是在没有阅读代码的情况下尝试了,最终将sources jar部署为二进制jar。这是一件需要谨慎对待的事情。使用二进制jar重新运行脚本修复了artifactory上的问题。