[
http://jira.codehaus.org/browse/MXMLBEANS-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=242975#action_242975
]
Nick Fortescue commented on MXMLBEANS-65:
-----------------------------------------
I've found a workaround which is ok. In my pom I add to the <configuration>:
<compiler>${env.JAVA_HOME}/bin/javac</compiler>
It would be nice if this was done automatically, or something similar.
> Plugin does not use maven javac for xsd compilation
> ---------------------------------------------------
>
> Key: MXMLBEANS-65
> URL: http://jira.codehaus.org/browse/MXMLBEANS-65
> Project: Maven 2.x Xmlbeans Plugin
> Issue Type: Bug
> Affects Versions: 2.3.3
> Environment: Windows
> Reporter: Nick Fortescue
>
> The normal windows Java installation installs both a JRE and a JDK with the
> JRE first in the path. It is well known in xmlbeans that if javac is not in
> the same directory as the java command used to run xml beans, that xmlbeans
> scomp will fail with the stack trace at the end of this post. Reference:
> http://wiki.apache.org/xmlbeans/XmlBeansFaq#scompFindingJavac
> The solution given there is to move the jdk in the path environment, however
> altering your path order just to get a maven plugin to run feels very hacky.
> However, given that the Maven plugin knows where javac lives already (or
> should do), it would be better if the plugin could modify either the scomp
> script or how it runs scomp (I'm not sure how it runs internally) so that the
> correct directory is used. See the comment about JAVA_HOME in the FAQ.
> I realise that this fix would be better done in xmlbeans, but given the
> problem has made the FAQ and still no-one has fixed it, I wondered if the
> maven plugin could do better, and add an equivalent of editing the script?
> CreateProcess error=2, The system cannot find the file specified
> at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
> at java.lang.Runtime.exec(Runtime.java:593)
> at java.lang.Runtime.exec(Runtime.java:466)
> at
> org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil.java:231)
> at
> org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1154)
> at
> org.codehaus.mojo.xmlbeans.AbstractXmlBeansPlugin.execute(AbstractXmlBeansPlugin.java:280)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> 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.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)
> 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
--
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 from this list, please visit:
http://xircles.codehaus.org/manage_email