Description
Netbeans modules are packaged as nbm files (and jars). The nbm packaging is very similar to a jar except it contains additional files, libraries, resources... The nbms are included in the maven repositories along side their smaller jar file counterparts, and there are times when a developer may want to unpack, copy,... the nbm file and NOT the jar file (since the nbm contains files that may be of use).
When I add the xml tag entry <type>nbm</type> to the artifactItem block, I expect it to get the 'nbm' and not the 'jar' item, but this is not the current behavior of the maven-dependency-plugin.
I have a situation where an nbm dependency contains/packages native libraries needed for JUnit tests to pass. I tried to use the maven-dependency-plugin to unpack the nbm during <phase>generate-test-resources</phase> so that I can put a specific mavenized version on my java.library.path for testing. But, discovered that nbm packaging is ignored by maven-dependency-plugin.
The below example should downloand and extract nbm file not the jar file from a maven repository.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>unpack</id> <phase>generate-test-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>someGroup</groupId> <artifactId>someArtifact</artifactId> <version>someVersion</version> <type>nbm</type> <outputDirectory>target/libs</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin>