Skip to content

Conversation

@treilhes
Copy link

This PR allows providing arbitrary dependencies to project properties through the plugin’s declared dependencies.
My main use case for this feature is the ability to patch a Java module with a dependency that is outside of the project’s dependency tree (mainly to solve duplicate package name).

See sample below


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>resolve-jar-path</id>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.somegroup</groupId>
                        <artifactId>someartifact</artifactId>
                        <version>someversion</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>--patch-module</arg>
                        <arg>module.to.patch=${com.somegroup:someartifact:jar}</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant