Skip to content
Christophe Marchand edited this page Sep 27, 2017 · 10 revisions

catalogBuilder-maven-plugin

This project is a maven plugin that generates an XML catalog used to resolve URIs that are in dependencies.

If you try to import a XSL that is in a dependency {groupId,artifactId,version}, maven resolves this dependency as a jar URL, and the plugin adds this in the catalog :

  <rewriteURI uriStartString="artifactId:/" rewritePrefix="jar:file:/home/cmarchand/.m2/repository/extern/groupId/artifactId/version/artifactId-version.jar!"/>
  <rewriteSystem systemIdStartString="artifactId:/" rewritePrefix="jar:file:/home/cmarchand/.m2/repository/extern/groupId/artifactId/version/artifactId-version.jar!"/>

Default is to use only the artifactId as prefix URL, but this can be changed using the patternUrl configuration parameter :

<plugin>
  <groupId>top.marchand.xml.maven</groupId>
  <artifactId>catalogBuilder-maven-plugin</artifactId>
  <version>1.0.4</version>
  <configuration>
    <patternUrl>groupId:artifactId:/</patternUrl>
  </configuration>
</plugin>

Be aware of patternUrl must end with a :/ .

If the whole jar file URL isn't an option to you, and imagine that you've invented a protocol that looks into classpath, you can change the rewrite to that protocol :

<plugin>
  <groupId>top.marchand.xml.maven</groupId>
  <artifactId>catalogBuilder-maven-plugin</artifactId>
  <version>1.0.4</version>
  <configuration>
    <rewriteToProtocol>cp:/</rewriteToProtocol>
  </configuration>
</plugin>

Other configuration options are :

  • catalogFileName : allow to specify another catalog file name
  • includeCurrentArtifact : true if you want to include the current project artifact in catalog. false by default. Since 1.0.5
Clone this wiki locally