Hi,

I have a big project, with 30-ish modules. Some of the modules need
native DLLs to be present in target/lib, so I want to use
m-dependency-p to unpack/copy them in place during the initialize
phase.

Let's just say there are two sets of these DLLs. Some of the modules
need one set, while some of the others need the other set. What I
would like is to avoid redundantly defining these executions in every
child POM that requires them, and only define both sets in the parent
POM, and "call" the appropriate one in the modules themselves.

But if I simply define them in the <pluginManagement> of the parent, like:

        <pluginManagement>
                <plugins>
                        <!-- Also copy the MS Visual C Runtime -->
                        <plugin>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <id>unpack-native-libs</id>
                                                <phase>initialize</phase>
                                                <goals>
                                                        <goal>unpack</goal>
                                                </goals>
                                                <configuration>
                                                        <artifactItems>
                                                                <artifactItem>
                                                                        
<groupId>com.microsoft.crt</groupId>
                                                                        
<artifactId>crt</artifactId>
                                                                        
<version>7.10</version>
                                                                </artifactItem>
                                                        </artifactItems>
                                                        
<outputDirectory>${project.build.directory}/lib</outputDirectory>
                                                </configuration>
                                        </execution>
                                        <execution>
                                                
<id>unpack-database-native-libs</id>
                                                <phase>initialize</phase>
                                                <goals>
                                                        
<goal>unpack-dependencies</goal>
                                                </goals>
                                                <configuration>
                                                        
<includeGroupIds>com.jadozoom</includeGroupIds>
                                                        
<includes>*.dll</includes>
                                                        
<outputDirectory>${project.build.directory}/lib</outputDirectory>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </pluginManagement>

...and reference one of them in a child POM:

        <build>
                <plugins>
                        <!-- Copy native libraries to target/lib -->
                        <plugin>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <id>unpack-native-libs</id>
                                        </execution>
                                </executions>
                        </plugin>

What I get is that _both_ executions I defined in parent get executed.
What I tried next is to set <inherited>false</inherited> in the parent
POM for the executions, but then _none_ of them get executed in the
child build.

Is there a way (maybe a completely different one) to achieve what I want?

BTW, I'm using Maven 3 for all this.

-- 
Thanks,
Lóránt

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to