You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Rod Coffin (JIRA)" <ji...@codehaus.org> on 2005/09/10 19:08:03 UTC

[jira] Updated: (MNG-862) Compiler arguments cause maven-compiler-plugin to fail when forked

     [ http://jira.codehaus.org/browse/MNG-862?page=all ]

Rod Coffin updated MNG-862:
---------------------------

    Attachment: patch-862.txt

This bug seems to be caused because the Plexus MapConverter creates a TreeMap and the CompilerConfiguration expects a LinkedHashMap.  These two are not directly subsitutable.  My patch simply converts the TreeMap to LinkedHashMap.  It would also be worthwhile considering whether the CompilerConfiguration should pass compiler arguments as a list instead of a map.

> Compiler arguments cause maven-compiler-plugin to fail when forked
> ------------------------------------------------------------------
>
>          Key: MNG-862
>          URL: http://jira.codehaus.org/browse/MNG-862
>      Project: Maven 2
>         Type: Bug
>   Components: maven-plugins
>     Versions: 2.0-beta-1
>     Reporter: Rod Coffin
>     Priority: Minor
>  Attachments: patch-862.txt
>
>
> Adding a compiler argument to a forked compiler causes maven to fail.  An example plugin configuration causing this error is:
> <plugin>
> 	<groupId>org.apache.maven.plugins</groupId>
> 	<artifactId>maven-compiler-plugin</artifactId>
> 	<configuration>
> 		<fork>true</fork>
> 		<executable>C:\oss\aspectj1.5\bin\ajc</executable>
> 		<source>1.5</source>
> 		<target>1.5</target>
> 		<compilerArguments>
> 			<sourceroot>src/main/java</sourceroot>
> 		</compilerArguments>
> 	</configuration>
> </plugin>
> The stack trace produced is:
> [ERROR] Cause:
> org.apache.maven.plugin.MojoExecutionException: Error configuring plugin for execution of 'compiler:compile'.
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:335)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:479)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:452)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:438)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:131)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:316)
>         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:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.PluginConfigurationException: Unable to parse the created DOM for plugin configuration
>         at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1019)
>         at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:515)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:330)
>         ... 15 more
> Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot assign value '{sourceroot=src/main/java}' to field: org.apache.maven.plugin.CompilerMojo.compilerArguments; type: java.util.TreeMap
>         at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingField(ComponentValueSetter.java:151)
>         at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:259)
>         at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:116)
>         at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:55)
>         at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1014)
>         ... 17 more
> Caused by: java.lang.IllegalArgumentException
>         at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
>         at java.lang.reflect.Field.set(Field.java:656)
>         at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingField(ComponentValueSetter.java:136)
>         ... 21 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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