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

Fix #220 - multimodule-module-with-parent there is a missing direct-dependency #329

Merged
merged 15 commits into from
Dec 6, 2022

Conversation

KemalSoysal
Copy link
Contributor

Hi @slawekjaranowski,

I created a new branch for issue #220 starting on top master and cherry-picked and adjusted.
Maybe this branch is better for a pull request.
I did not want to force push the bugfix/220 branch.

Best Regards,

Kemal

pom.xml Outdated Show resolved Hide resolved
@@ -83,7 +82,7 @@
private SuperPomProvider superPomProvider;

@Inject
private InheritanceAssembler inheritanceAssembler;
private DirectDependenciesInheritanceAssembler inheritanceAssembler;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe using a @Named annotation instead of the implementation class to choose which implementation is to be injected ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get a NullPointer when using @Named instead of @Inject and using InheritanceAssembler
And using InheritanceAssembler with @Inject retrieves the DefaultImplementation
Cannot invoke "org.apache.maven.model.inheritance.InheritanceAssembler.assembleModelInheritance(org.apache.maven.model.Model, org.apache.maven.model.Model, org.apache.maven.model.building.ModelBuildingRequest, org.apache.maven.model.building.ModelProblemCollector)" because "this.inheritanceAssembler" is null

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to add it on both the injection point and the DirectDependenciesInheritanceAssembler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That DirectDependenciesInheritanceAssembler has @Named annotation... maybe the annotations are from wrong package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works with @Component( role = InheritanceAssembler.class ) on the DirectDependenciesInheritanceAssembler and with @Inject on the InheritanceAssembler field.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wanted to get rid of the DirectDependenciesInheritanceAssembler and use the interface instead, but the implementation is actually used, so that can't be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the FlattenMojo there is a direct usage of the implementation, yes.

pom.xml Outdated Show resolved Hide resolved
@slawekjaranowski slawekjaranowski changed the title Bugfix/220_2 for #220 Fix #220 - multimodule-module-with-parent there is a missing direct-dependency Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

for multimodule-module-with-parent there is a missing direct-dependency test case
3 participants