Skip to content

Referencing Resources in Maven Artifacts

highsource edited this page Oct 12, 2014 · 2 revisions

The URI syntax for Maven artifact resources is as follows:

maven:groupId:artifactId:type:classifier:version!/my/schema.xsd
  • groupId is required.
  • artifactId is required.
  • type is optional, defaults to jar.
  • classifier is optional, default to none.
  • version is optional if artifact is defined in project dependencies or dependency management.
  • !/ is used as resource delimiter.

A few examples:

  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a!/a.xsd - a.xsd from the main maven-jaxb2-plugin-tests-episodes-a JAR.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a:jar!/a.xsd - equivalent to above.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a:jar:!/a.xsd - equivalent to above.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a:jar::!/a.xsd - equivalent to above.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a:::!/a.xsd - equivalent to above.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a:::0.8.1!/a.xsd - using a specific version, type is defaulted to jar.
  • maven:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-tests-episodes-a::sources!/a.xsd - a.xsd from the sources JAR.
Clone this wiki locally