You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Simone Tripodi <si...@gmail.com> on 2019/01/23 08:53:21 UTC

No implementation for org.apache.maven.model.resolution.ModelResolver was bound

Hi all mates,

I have been developing an OSS MOJO where, when executed, Maven is not
able to inject required components due to the the error below:

~~~~
Execution apis-jar of goal
org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar
failed: Unable to load the mojo 'apis-jar' (or one of its required
components) from the plugin
'org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT':
com.google.inject.ProvisionException: Unable to provision, see the
following errors:

[ERROR]
[ERROR] 1) No implementation for
org.apache.maven.model.resolution.ModelResolver was bound.
[ERROR]   while locating org.apache.sling.feature.maven.mojos.ApisJarMojo
[ERROR]   at ClassRealm[extension>org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT,
parent: sun.misc.Launcher$AppClassLoader@3d4eac69] (via modules:
org.eclipse.sisu.wire.WireModule ->
org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR]   while locating org.apache.maven.plugin.Mojo annotated with
@com.google.inject.name.Named(value=org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar)
[ERROR]
[ERROR] 1 error
[ERROR]       role: org.apache.maven.plugin.Mojo
[ERROR]   roleHint:
org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar
~~~~

The right dependency is declared in the POM:

~~~~
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model-builder</artifactId>
            <version>3.6.0</version>
        </dependency>
~~~~

that seems to contain correct metadata in `META-INF/plexus/components.xml`

Error happens in this environment:

~~~~
$ mvn -version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
PermSize=256m; support was removed in 8.0
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe;
2018-06-17T20:33:14+02:00)
Maven home: /Applications/apache-maven-3.5.4
Java version: 1.8.0_152, vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
Default locale: en_CH, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
~~~~

Do you have any hint on how to fix it?
Many thanks in advance!
~Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: No implementation for org.apache.maven.model.resolution.ModelResolver was bound

Posted by Stuart McCulloch <mc...@gmail.com>.
ModelResolver isn't a component and therefore isn't available for injection
- I can see two implementations of that interface in Maven, but both are
manually created:


https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java#L276


https://github.com/apache/maven/blob/master/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java#L280

Of the two implementations ProjectModelResolver is the only one that's
public

On Wed, 23 Jan 2019 at 08:53, Simone Tripodi <si...@gmail.com>
wrote:

> Hi all mates,
>
> I have been developing an OSS MOJO where, when executed, Maven is not
> able to inject required components due to the the error below:
>
> ~~~~
> Execution apis-jar of goal
> org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar
> failed: Unable to load the mojo 'apis-jar' (or one of its required
> components) from the plugin
> 'org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT':
> com.google.inject.ProvisionException: Unable to provision, see the
> following errors:
>
> [ERROR]
> [ERROR] 1) No implementation for
> org.apache.maven.model.resolution.ModelResolver was bound.
> [ERROR]   while locating org.apache.sling.feature.maven.mojos.ApisJarMojo
> [ERROR]   at
> ClassRealm[extension>org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT,
> parent: sun.misc.Launcher$AppClassLoader@3d4eac69] (via modules:
> org.eclipse.sisu.wire.WireModule ->
> org.eclipse.sisu.plexus.PlexusBindingModule)
> [ERROR]   while locating org.apache.maven.plugin.Mojo annotated with
>
> @com.google.inject.name.Named(value=org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar)
> [ERROR]
> [ERROR] 1 error
> [ERROR]       role: org.apache.maven.plugin.Mojo
> [ERROR]   roleHint:
> org.apache.sling:slingfeature-maven-plugin:0.8.1-SNAPSHOT:apis-jar
> ~~~~
>
> The right dependency is declared in the POM:
>
> ~~~~
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-model-builder</artifactId>
>             <version>3.6.0</version>
>         </dependency>
> ~~~~
>
> that seems to contain correct metadata in `META-INF/plexus/components.xml`
>
> Error happens in this environment:
>
> ~~~~
> $ mvn -version
> Java HotSpot(TM) 64-Bit Server VM warning: ignoring option
> PermSize=256m; support was removed in 8.0
> Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe;
> 2018-06-17T20:33:14+02:00)
> Maven home: /Applications/apache-maven-3.5.4
> Java version: 1.8.0_152, vendor: Oracle Corporation, runtime:
> /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
> Default locale: en_CH, platform encoding: UTF-8
> OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"
> ~~~~
>
> Do you have any hint on how to fix it?
> Many thanks in advance!
> ~Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>