GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added ability to provide arbitrary dependencies to properties mojo by treilhes · Pull Request #1561 · apache/maven-dependency-plugin

Conversation

@treilhes

@treilhes treilhes commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

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>

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@desruisseaux

desruisseaux commented Nov 19, 2025

Copy link
Copy Markdown

It seems related to #1560, maybe a replacement?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@treilhes

treilhes commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

@desruisseaux
It is the same content you can safely forget about #1560

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slawekjaranowski
slawekjaranowski requested changes Nov 22, 2025
View reviewed changes

@slawekjaranowski slawekjaranowski left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that adding artifacts to plugin dependencies is not good idea ...
it will be added to plugin classpath - that is not needed.

I would prefer add a new parameters for additional artifact, next artifact can be resolved and file path can be added to properties

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slawekjaranowski slawekjaranowski added the waiting-for-feedback Waiting for 90 days until issues or pull request will be closed label Jan 27, 2026
@github-actions

github-actions Bot commented Mar 29, 2026

Copy link
Copy Markdown

This pull request is stale because it has been waiting for feedback for 60 days. Remove the stale label or comment on this PR, or it will be automatically closed in 30 days.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the Stale label Mar 29, 2026
@treilhes
treilhes force-pushed the master branch from 031ee17 to d5b3238 Compare April 7, 2026 01:41
@treilhes
Added ability to provide arbitrary dependencies to properties mojo
9109760
@treilhes
treilhes force-pushed the master branch from d5b3238 to 9109760 Compare April 7, 2026 01:45
@treilhes
treilhes requested a review from slawekjaranowski April 7, 2026 01:47
@treilhes

treilhes commented Apr 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Hello @slawekjaranowski

Updated as requested, now you may use the plugin as follow:


    <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>
                <configuration>
                    <extraArtifacts>
                        <extraArtifact>
                            <groupId>com.somegroup</groupId>
                            <artifactId>someartifact</artifactId>
                            <version>someversion</version>
                        </extraArtifact>
                    </extraArtifacts>
                </configuration>
            </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>

slawekjaranowski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed waiting-for-feedback Waiting for 90 days until issues or pull request will be closed Stale labels Apr 7, 2026
@slawekjaranowski slawekjaranowski added the enhancement New feature or request label May 5, 2026
@treilhes
fix spotless violation
6a5ea10
slawekjaranowski
slawekjaranowski approved these changes May 7, 2026
View reviewed changes
@slawekjaranowski
slawekjaranowski merged commit 963fd3c into apache:master May 7, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added this to the 3.10.1 milestone May 7, 2026
@github-actions github-actions Bot assigned slawekjaranowski May 7, 2026
@slawekjaranowski

slawekjaranowski commented May 7, 2026

Copy link
Copy Markdown
Member

@treilhes thanks

treilhes reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@slawekjaranowski slawekjaranowski slawekjaranowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@slawekjaranowski slawekjaranowski

Labels

enhancement New feature or request

Projects

None yet

Milestone

3.11.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@treilhes @desruisseaux @slawekjaranowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.