Skip to content

Cannot find PathMatcherFactory at test integration time #10965

@desruisseaux

Description

@desruisseaux

Affected version

Maven 4.0.0-SNAPSHOT

Bug description

Following the integration of #10926, I tried to use the new factory in the Maven Clean Plugin. The following field has been added to the CleanMojo class:

@Inject
private PathMatcherFactory matcherFactory;

It works at JUnit execution time: the factory is correctly injected. But when executing integration tests, I get the following exception:

org.apache.maven.di.impl.DIException: No binding to construct an instance for key PathMatcherFactory.  Existing bindings:
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:clean") CleanMojo
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:clean") CleanMojoFactory
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:clean") Mojo
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:clean") Object
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:help") HelpMojo
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:help") HelpMojoFactory
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:help") Mojo
 - @Named("org.apache.maven.plugins:maven-clean-plugin:4.0.0-beta-3-SNAPSHOT:help") Object
 - CleanMojo
 - CleanMojoFactory
 - HelpMojo
 - HelpMojoFactory
 - Log
 - Mojo
 - MojoExecution
 - Object
 - Project
 - ProtoSession
 - Session
    at org.apache.maven.di.impl.InjectorImpl.doGetCompiledBinding(InjectorImpl.java:262)
    at org.apache.maven.di.impl.InjectorImpl.getCompiledBinding(InjectorImpl.java:200)
    (...snip...)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:346)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:310)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:214)
    (...snip...)

Steps to reproduce:

I tried to get the factory registered in different way, shown in this commit, but none of them worked. I'm sure that I did something wrong, but haven't identified what yet...

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:blockerBlocks development and/or testing work, production could not run

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions