java - How to avoid parent pom from maven dependency? -


my project "xyz" needs dependency jar , "a.jar".

this a.jar having parent pom "b.pom" (not jar), parent pom file not present in repository not uploaded during release of a.jar.

now, when build xyz, tries download parent "b.pom" along dependency "a.jar". , fails. there way exclude parent pom of dependency "a.jar" ? using maven 3.

thanks rob

you can define plugins in parent pom in pluginmanagement section

<pluginmanagement>             <plugins>                 ...                  <plugin>                     <artifactid>maven-dependency-plugin</artifactid>                     <version>2.8</version>                     <executions>                         <execution>                             <id>unpack-dependencies</id>                             <phase>generate-sources</phase>                             <goals>                                 <goal>unpack-dependencies</goal>                             </goals>                             <configuration>                                 <includetypes>tar.bz2</includetypes>                                 <outputdirectory>${project.basedir}/target/dependencies</outputdirectory>                             </configuration>                         </execution>                     </executions>                 </plugin>               ...             </plugins> </pluginmanagement> 

and after in parent , child poms can control execution phase of plugin.if paste in parent pom not forget option <inherited>false</inherited>, disable execution inheritance in child pom.

<plugins>       <plugin>             <artifactid>maven-dependency-plugin</artifactid>             <inherited>false</inherited>             <executions>                 <execution>                     <id>unpack-dependencies</id>                     <phase>none</phase>                 </execution>             </executions>         </plugin>   </plugins> 

Comments