logo Apache Maven Remote Resources Plugin

Process resources packaged in JARs that have been deployed to a remote repository. The primary use case being satisfied is the consistent inclusion of common resources in a large set of projects. Maven projects at Apache use this plug-in to satisfy licensing requirements at Apache where each project must include license and notice files for each release.

homepage: maven.apache.org/plugins
fresh index:
last release: 2 years ago, first release: 2 decades ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
remote-resources:bundle (phase: generate-resources)

Bundle up resources that should be considered as a remote-resource, generating META-INF/maven/remote-resources.xml descriptor.

remote-resources:help

Display help information on maven-remote-resources-plugin. Call mvn remote-resources:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.

remote-resources:process (phase: generate-resources)

Pull down resourceBundles containing remote resources and process the resources contained inside. When that is done, the resources are injected into the current (in-memory) Maven project, making them available to the process-resources phase. Resources that end in ".vm" are treated as Velocity templates. For those, the ".vm" is stripped off for the final artifact name and it's fed through Velocity to have properties expanded, conditions processed, etc... Resources that don't end in ".vm" are copied "as is".

Often used code snippets:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>bundle</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <id>xwiki-platform-tool-configuration-resources</id>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <executions>
    <execution>
      <id>xwiki-license-resources</id>
    </execution>
  </executions>
</plugin>
<plugin>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <version>1.5</version>
  <executions>
    <execution>
      <goals>
        <goal>bundle</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <includes>
      <include>**/*.exe</include>
    </includes>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-remote-resources-plugin</artifactId>
  <dependencies>
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-tool-license-resources</artifactId>
      <version>${commons.version}</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <id>xwiki-license-resources</id>
      <goals>
        <goal>process</goal>
      </goals>
      <configuration>
        <resourceBundles>
          <resourceBundle>org.xwiki.commons:xwiki-commons-tool-license-resources:${commons.version}</resourceBundle>
        </resourceBundles>
      </configuration>
    </execution>
  </executions>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.