Hi all,

sorry it took so long to reply, but here are my findings:

> I remember when I was writing that plugin I found a couple of use cases
for
> tool chains that the initial spec had missed... there could be some hack
I'm
> doing... also are you using maven 2 or 3.

I am using Maven 3; while animal-sniffer:check works just fine,
animal-sniffer:build has problems. :-(

> I have not tested animal-sniffer-maven-plugin for generating signatures
with
> maven 3 so it might be that it only works in 2.0.10-2.2.1

Yes, it looks like that is the case: when asking explicitly for a toolchain
in the plugin's configuration, I get the following error:

[ERROR] Failed to execute goal
org.codehaus.mojo:animal-sniffer-maven-plugin:1.6:build (build) on project
test: Incompatible toolchain API:
org.apache.maven.toolchain.DefaultToolchainManager.getToolchainsForType(java.lang.String)
-> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.6:build (build) on
project test: Incompatible toolchain API
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Incompatible
toolchain API
        at
org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.getToolchains(BuildSignaturesMojo.java:686)
        at
org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.getToolchainFromConfiguration(BuildSignaturesMojo.java:637)
        at
org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.getToolchain(BuildSignaturesMojo.java:600)
        at
org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.execute(BuildSignaturesMojo.java:286)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NoSuchMethodException:
org.apache.maven.toolchain.DefaultToolchainManager.getToolchainsForType(java.lang.String)
        at java.lang.Class.getMethod(Class.java:1605)
        at
org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.getToolchains(BuildSignaturesMojo.java:679)
        ... 24 more

This is due to the fact that an instance of class
org.apache.maven.toolchain.DefaultToolchainManager is injected into the
ToolchainManager @component, which is not a ToolchainManagerPrivate. So it
looks like one has to explicitly request a ToolchainManagerPrivate
@component; just asking for a ToolchainManager does not get one a
ToolchainManagerPrivate.

That being said, I found the "jdk"-type toolchains lacking some information
for my purpose. You only get the jdkHome, but not, e.g., JVM arguments
(like -client or -server). This way is it quite hard to run you tests on
different JVM configurations, as all you get is just the paths to the
"java" executables. :-(

So I am switching back to a single toolchain (obtained via
ToolchainManager) for now.

Best wishes,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to