Skip to content

🐛 fix: Remove Plugin Test Dependencies#1488

Open
adambkaplan wants to merge 2 commits intochains-project:mainfrom
adambkaplan:fix-plugin-scope
Open

🐛 fix: Remove Plugin Test Dependencies#1488
adambkaplan wants to merge 2 commits intochains-project:mainfrom
adambkaplan:fix-plugin-scope

Conversation

@adambkaplan
Copy link
Contributor

@adambkaplan adambkaplan commented Feb 3, 2026

Use an ArtifactFilter to only include compile and runtime scope dependencies. This will exclude all test scope dependencies in the plugin dependency graph. Maven requires plugins to have their compile and runtime dependency tree present in the local Maven repository in order to function.

Fixes #1445

@adambkaplan adambkaplan changed the title fix: Remove Plugin Test Dependencies 🐛 Remove Plugin Test Dependencies Feb 3, 2026
@adambkaplan
Copy link
Contributor Author

This is an alternative to #1487 and #1465 .

@adambkaplan
Copy link
Contributor Author

fyi @LogFlames @akallian-eng

@adambkaplan adambkaplan changed the title 🐛 Remove Plugin Test Dependencies 🐛 fix: Remove Plugin Test Dependencies Feb 3, 2026
Use an ArtifactFilter to only include compile and runtime scope
dependencies. This will exclude all test scope dependencies in
the plugin dependency graph. Maven requires plugins to have their
compile and runtime dependency tree present in the local Maven
repository in order to function.

Assisted-by: Cursor
Signed-off-by: Adam Kaplan <adam.kaplan@redhat.com>
@LogFlames
Copy link
Member

Thanks @adambkaplan !

Will be happy to merge this, however, there is a problem related when the user overwrites the plugin dependencies which could change the scope. Thus if the user changes the scope, a test dependency might get filtered out, even though its a different scope and should be included.

      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>4.2.1</version>
        <inherited>false</inherited>
        <dependencies>
          <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>5.0.3</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
        <executions>
            ....
        </executions>
      </plugin>

I have added a commit to this branch with a suggestion to solve it. If you have time to review the code and it looks good we can merge. Otherwise feel free to remove my commit entirely if you prefer some alternative solution :)

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.

Plugin Dependencies Include test Scope

2 participants