Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Dependency resolution of Mojos #30

Open
lppedd opened this issue Sep 22, 2022 · 1 comment
Open

[Question] Dependency resolution of Mojos #30

lppedd opened this issue Sep 22, 2022 · 1 comment

Comments

@lppedd
Copy link

lppedd commented Sep 22, 2022

I was looking at the plugin's Mojos (but specifically at the Execute one) and I've noticed they use requiresDependencyResolution = TEST. Why do these Mojos require dependency resolution in all cases?

The execute goal bound to generate-sources fails in my multi-module project using Eclipse Tycho, because some modules might not be already built. Wouldn't requiresDependencyCollection be a better alternative?

The important difference is that this annotation will not resolve the files for the dependencies, i.e. the artifacts associated with a Maven project can lack a file. As such, this annotation is meant for mojos that only want to analyze the set of transitive dependencies, in particular during early lifecycle phases where full dependency resolution might fail due to projects which haven't been built yet

@jdillon
Copy link
Member

jdillon commented Sep 23, 2022

The requiresDependencyResolution = TEST configuration simply means when executing this mojo make sure to resolve the dependencies of the project in context to the scope of TEST.

This allows use of gmaven:execute on projects and allow it to resolve the classes which are defined in src/java/test. The requiresDependencyCollection flag only makes the information about dependencies available but wouldn't allow the invocation to resolve those classes.

The intent was to allow the gmaven:execute goal here to use main/test classes from the context in whatever groovy script execution.

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

No branches or pull requests

2 participants