Maven-dependency-plugin (unpack-dependencies) ignores configuration

titaniche

The following problem occurred: There is a dependency in the project. The dependency contains .js and .css files (essentially they will be used as resources). I need to extract and put these files in a certain place. I thought to use maven-dependency-plugin for this, but it does not use the configuration I specified (use defaults). Please tell me where I could be wrong.

pom.xml:

<dependencies>
    <dependency>
        <groupId>my.group.Id</groupId>
        <artifactId>my-artifact-id</artifactId>
        <version>my_version</version>
    </dependency>
</dependencies>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeScope>runtime</includeScope>
                            <includeGroupIds>my.group.Id</includeGroupIds>
                            <includeArtifactIds>my-artifact-id</includeArtifactIds>
                            <includes>**/*.js,**/*.css</includes>
                            <outputDirectory>${project.basedir}/my/path</outputDirectory>
                            <overwriteReleases>true</overwriteReleases>
                            <overwriteSnapshots>true</overwriteSnapshots>
                            <overwriteIfNewer>true</overwrteIfNewer>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Daniel

You are declaring your plugin execution inside a <pluginManagement> section. This section is great for putting configuration in one place and reusing it later, but it won't execute your plugin.

Try this:

  <build>
      <pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId> <!-- your example contained a typo. -->
                  <artifactId>maven-dependency-plugin</artifactId>
                  <version>2.10</version>
                  <executions>
                      <execution>
                          <id>unpack</id>
                          <phase>generate-resources</phase>
                          <goals>
                              <goal>unpack-dependencies</goal>
                          </goals>
                          <configuration>
                              <includeScope>runtime</includeScope>
                              <includeGroupIds>commons-lang</includeGroupIds>
                              <includeArtifactIds>commons-lang</includeArtifactIds>
                              <includes>**/*.js,**/*.css</includes>
                              <outputDirectory>${project.basedir}/my/path</outputDirectory>
                              <overwriteReleases>true</overwriteReleases>
                              <overwriteSnapshots>true</overwriteSnapshots>
                              <overwriteIfNewer>true</overwriteIfNewer> <!-- Typo in your POM here as well -->
                          </configuration>
                      </execution>
                  </executions>
              </plugin>
          </plugins>
      </pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
        </plugin>
      </plugins>
   </build>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

maven-dependency-plugin:unpack ignores type configuration

From Dev

Maven unpack-dependencies of a plugin dependency

From Dev

maven-dependency-plugin ignores outputDirectory configuration

From Dev

Maven maven-dependency-plugin copy-dependencies ignores outputDirectory

From Dev

How to unpack just the files from a sub-folder in maven-dependency-plugin with goal unpack-dependencies?

From Dev

maven dependency plugin ignores dependency versions?

From

maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e

From Java

Maven dependency management for plugin dependencies

From Dev

maven-dependency-plugin:unpack Error

From Dev

Maven dependency plugin copy jar with dependencies

From Dev

Maven plugin dependencies couldn't resolve dependency from internal repo

From Java

maven-shade-plugin : exclude a dependency and all its transitive dependencies

From Java

Suppress Maven Dependency Plugin's "Unused declared dependencies found" warnings

From Java

Spring boot core dependencies seen as unused by maven-dependency-plugin

From Dev

How does Maven Dependency Plugin determine used dependencies

From Dev

maven exclude plugin in dependency

From Dev

Maven resources plugin dependency

From Dev

Maven PlugIn Dependency Exception

From Java

Maven: Unpack-Dependencies ... and then forget about them

From Dev

Maven same dependency in multiple dependencies

From Dev

Find dependencies of a Maven Dependency object

From Dev

maven-dependency-plugin can't exclude test-scope dependencies

From Java

maven-dependency-plugin generates duplicate files in jar-with-dependencies.jar file

From Java

How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency

From Dev

Maven Plugin Dependency : class not found

From Dev

How to show dependency of a plugin in Maven?

From Dev

How to scan maven plugin dependency?

From Dev

Maven assembly plugin add dependencies

From Dev

Maven shade plugin - Jar and dependencies

Related Related

  1. 1

    maven-dependency-plugin:unpack ignores type configuration

  2. 2

    Maven unpack-dependencies of a plugin dependency

  3. 3

    maven-dependency-plugin ignores outputDirectory configuration

  4. 4

    Maven maven-dependency-plugin copy-dependencies ignores outputDirectory

  5. 5

    How to unpack just the files from a sub-folder in maven-dependency-plugin with goal unpack-dependencies?

  6. 6

    maven dependency plugin ignores dependency versions?

  7. 7

    maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e

  8. 8

    Maven dependency management for plugin dependencies

  9. 9

    maven-dependency-plugin:unpack Error

  10. 10

    Maven dependency plugin copy jar with dependencies

  11. 11

    Maven plugin dependencies couldn't resolve dependency from internal repo

  12. 12

    maven-shade-plugin : exclude a dependency and all its transitive dependencies

  13. 13

    Suppress Maven Dependency Plugin's "Unused declared dependencies found" warnings

  14. 14

    Spring boot core dependencies seen as unused by maven-dependency-plugin

  15. 15

    How does Maven Dependency Plugin determine used dependencies

  16. 16

    maven exclude plugin in dependency

  17. 17

    Maven resources plugin dependency

  18. 18

    Maven PlugIn Dependency Exception

  19. 19

    Maven: Unpack-Dependencies ... and then forget about them

  20. 20

    Maven same dependency in multiple dependencies

  21. 21

    Find dependencies of a Maven Dependency object

  22. 22

    maven-dependency-plugin can't exclude test-scope dependencies

  23. 23

    maven-dependency-plugin generates duplicate files in jar-with-dependencies.jar file

  24. 24

    How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency

  25. 25

    Maven Plugin Dependency : class not found

  26. 26

    How to show dependency of a plugin in Maven?

  27. 27

    How to scan maven plugin dependency?

  28. 28

    Maven assembly plugin add dependencies

  29. 29

    Maven shade plugin - Jar and dependencies

HotTag

Archive