0

Using following command(curl component API) to upload a pom file to Nexus 3 server.

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

Got 400 and following error.

[{"id":"*","message":"The provided POM file is invalid. Could not retrieve valid G:A:V parameters (com.xxx.xxx:xxx-xxx:${sdk.starter.version})"}]

Seem there is a placeholder in pom file and it's not valid for Nexus 3 component API. I tried using maven deploy instead of API and it worked.

But is there any way that i could just upload it with API calling and bypass the validation?

Puffy
  • 30
  • 6

1 Answers1

1

If there is a property like ${sdk.starter.version} in the version tag, it does not make sense to upload the pom file (as it is) to Nexus. You will not be able to use or reference it from anywhere if it does not have a valid version number.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • I do not think this holds true anymore, as nexus can validate pom files now with the use of a parent pom, so often it is an indication that the version defined in the parent pom is wrong. if of course a parent pom is used. – Lars Hendriks Feb 07 '22 at 14:31