Search code examples
javamavenmaven-pluginnexusmaven-assembly-plugin

maven upload file to Nexus repo without groupId and artifactId


I have a zip file and a Nexus repo and I would like to know if it is possible to create a goal to upload the zip file in the repot root folder, without groupId and artifactId

my artifact is build by a pom.xml


Solution

  • It depends on the type of repository declared in your Nexus 3 instance.

    For a Maven one, you need a GAV (group/artifactID/Version).
    (NEXUS-5170 is illustrates that, even without a GAV, the GUI still proposes 'Add Artifact', but that is a bug)

    In your case, as a workaround, you would create one "default/root" group dedicated to host those kind of artifacts: one group to host them all.
    You can then use deploy:deploy-file, which, as you have seen, requires a GAV.

    But if your artifact is built by a pom.xml (which does specify the GAV), a simple mvn deploy is enough (target deploy:deploy)