将 pom 文件上传到 Nexus 3 并出现错误 'The provided POM file is invalid'
Upload pom file to Nexus 3 and get error 'The provided POM file is invalid'
使用以下命令(curl 组件 API)将 pom 文件上传到 Nexus 3 服务器。
curl -v -u account:password -X POST 'http://local_repo_address/service/rest/v1/components?repository='$repo -F maven2.groupId=$groupId -F maven2.artifactId=$ artifactId -F maven2.version=$version -F maven2.asset1=@$=file_path -F maven2.asset1.extension=$file_type
得到 400 和以下错误。
[{"id":"*","message":"The provided POM file is invalid. Could not retrieve valid G:A:V parameters (com.xxx.xxx:xxx-xxx:${sdk.starter.version})"}]
pom 文件中似乎有一个占位符,它对 Nexus 3 组件无效 API。
我尝试使用 maven deploy 而不是 API 并且它有效。
但是有什么方法可以通过 API 调用上传它并绕过验证吗?
如果版本标签中有${sdk.starter.version}
之类的属性,将pom文件(原样)上传到Nexus是没有意义的。如果它没有有效的版本号,您将无法从任何地方使用或引用它。
使用以下命令(curl 组件 API)将 pom 文件上传到 Nexus 3 服务器。
curl -v -u account:password -X POST 'http://local_repo_address/service/rest/v1/components?repository='$repo -F maven2.groupId=$groupId -F maven2.artifactId=$ artifactId -F maven2.version=$version -F maven2.asset1=@$=file_path -F maven2.asset1.extension=$file_type
得到 400 和以下错误。
[{"id":"*","message":"The provided POM file is invalid. Could not retrieve valid G:A:V parameters (com.xxx.xxx:xxx-xxx:${sdk.starter.version})"}]
pom 文件中似乎有一个占位符,它对 Nexus 3 组件无效 API。 我尝试使用 maven deploy 而不是 API 并且它有效。
但是有什么方法可以通过 API 调用上传它并绕过验证吗?
如果版本标签中有${sdk.starter.version}
之类的属性,将pom文件(原样)上传到Nexus是没有意义的。如果它没有有效的版本号,您将无法从任何地方使用或引用它。