0

Consider I'm a Maven plugin and I'd like to read Maven Repository Metadata (maven-metadata.xml) for certain group or artifact from a remote repository (Nexus in this case).

Is there a built-in Maven functionality available to a plugin to retrieve this piece of information?

My use case is the following: I've got a list of artifacts in a proprietary file format. Each of these artifacts might have an according configuration artifact stored in Nexus but not listed in the file. Also, not all artifacts have a version applied. Now I'd like to create a standard BOM and I'd like to leverage information available in maven-metadata.xml.

carlspring
  • 31,231
  • 29
  • 115
  • 197
thokuest
  • 5,800
  • 24
  • 36
  • For what purpose do you need to read the metadata ? – khmarbaise Oct 09 '15 at 15:27
  • Thanks for the interest, I added my use case to the question. – thokuest Oct 10 '15 at 15:10
  • 1
    First from my point of view storing artifacts in a repository without version information does not make sense. The same for the configuration artifacts...which could simply being added by using buildhelper-maven-plugin (attach-artifact)...than you have defaults where you can go with...That those artifacts are proprietary format does not matter...If they are not mentioned in the metadata usually means you don't update the meta-data from Nexus (You can configure a task to do this)... – khmarbaise Oct 12 '15 at 19:44

1 Answers1

0

You can use below code.I am doing this in my project and its working for me:

 <repositories>
        <repository>
            <id>YOUR_ID</id>
            <url>NEXUS_URL</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
chetanpawar
  • 141
  • 1
  • 6