1

My company's infrastructure changed which forced upgrade from Maven 2.2.1 to maven 3.0.5

Structure of my project is one EAR containing a few modules. EAR's dependencies are stored in it's lib folder which is on the classpath, and all of the modules can use it. When we have a dependency that is used by more than module it's added as an EAR's dependency in scope compile and in scope provided for modules that need it - this way files are not doubled.

After upgrade dependencies with scope provided are treated differently. Their transitive dependencies are added to their module's lib folder. This causes conflicts.

I've found a proposed solution after some research - configure maven-dependency-plugin to <excludeScope>provided</excludeScope> during <goal>copy-dependencies</goal>, but it changes nothing - transient dependencies are added to modules' lib folder anyway.

Do I understand the problem wrong? What changed between maven 2 and 3 that causes this?

Regards, Jan

Plugin configuration in troublesome module:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
            <execution>
                <id>copy-dependencies</id>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <excludeScope>provided</excludeScope>
                </configuration>
            </execution>
        </executions>
    </plugin>
Jan Siekierski
  • 409
  • 6
  • 14

0 Answers0