The problem is at this line c = cl.loadClass( "com.sun.tools.javac.Main" ); in http://svn.plexus.codehaus.org/trunk/plexus-components/plexus-compiler/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java?rev=2727&view=auto
I don't know why this should be a problem as nobody else is reporting problems under mac and some of the developers are using it. Maybe you have different security options in your JDK? Workarounds may be using some of the compiler options, like fork or compilerId http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html BTW Sources for the compile plugin are at http://svn.apache.org/viewcvs.cgi/maven/plugins/trunk/maven-compiler-plugin/ svn co http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-compiler-plugin On 12/20/05, Conrad O'Dea <[EMAIL PROTECTED]> wrote: > Hi Carlos, > > On 19 Dec 2005, at 22:26, Carlos Sanchez wrote: > > > Can you try with 2.0? > > I tried this with 2.0 and the same exception is being raised. > > It looks like a ClassLoader in the maven-compiler-plugin is trying to > define a class from the java.lang package, which is not allowed. > I've been trying to get to the source code of the plugin to try and > dig a little deeper into what's going on but it does not seem to be > available. Trying to view through web-access at [1] gets a 404 and > trying a subversion checkout [2] results in a 'path not found' error. > > Any clues as to what may be going on or how to get the relevant > source would be appreciated. > > thanks > Conrad > > > [1] http://svn.apache.org/viewcvs.cgi/maven/components/trunk/maven- > plugins/maven-compiler-plugin > [2] svn checkout http://svn.apache.org/repos/asf/maven/components/ > trunk/maven-plugins/maven-compiler-plugin maven-compiler-plugin > > > > > On 12/19/05, Conrad O'Dea <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I've run into a problem with maven on OS X and JDK 1.5. We're just > >> starting to migrate our project over to Maven 2 and the initial > >> project will not build on my Mac. I can reproduce the problem by > >> creating a 'Hello World' project using this command: > >> > >> $ mvn archetype:create -DgroupId=foo.bar -DartifactId=foo-bar > >> > >> and after a chunk of output, it printed 'BUILD SUCCESSFUL'. However, > >> when compiling the project, it fails with the following error (full > >> stack trace at end of mail). > >> > >> [ERROR] BUILD ERROR > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] Fatal error compiling > >> > >> Embedded error: Prohibited package name: java.lang > >> > >> If I switch to a 1.4 JDK, the project builds without problems. > >> Unfortunately our actual project requires JDK 1.5. > >> > >> Can anyone give advice on what, if anything, I can do to workaround > >> this? > >> > >> thanks > >> Conrad > >> > >> $ mvn --version > >> Maven version: 2.0.1 > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ java -version > >> java version "1.5.0_05" > >> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83) > >> Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing) > >> > >> $ mvn -e compile > >> + Error stacktraces are turned on. > >> [INFO] Scanning for projects... > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] Building Maven Quick Start Archetype > >> [INFO] task-segment: [compile] > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] [resources:resources] > >> [INFO] Using default encoding to copy filtered resources. > >> [INFO] [compiler:compile] > >> Compiling 1 source file to /Users/codea/scratch/maven/foo-bar/target/ > >> classes > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [ERROR] BUILD ERROR > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] Fatal error compiling > >> > >> Embedded error: Prohibited package name: java.lang > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] Trace > >> org.apache.maven.lifecycle.LifecycleExecutionException: Fatal error > >> compiling > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals > >> (DefaultLifecycleExecutor.java:555) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi > >> fec > >> ycle(DefaultLifecycleExecutor.java:472) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal > >> (DefaultLifecycleExecutor.java:451) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan > >> dle > >> Failures(DefaultLifecycleExecutor.java:303) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen > >> ts( > >> DefaultLifecycleExecutor.java:270) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute > >> (DefaultLifecycleExecutor.java:139) > >> at org.apache.maven.DefaultMaven.doExecute > >> (DefaultMaven.java:322) > >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: > >> 115) > >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) > >> 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.MojoExecutionException: Fatal > >> error compiling > >> at org.apache.maven.plugin.AbstractCompilerMojo.execute > >> (AbstractCompilerMojo.java:412) > >> at org.apache.maven.plugin.CompilerMojo.execute > >> (CompilerMojo.java:110) > >> at org.apache.maven.plugin.DefaultPluginManager.executeMojo > >> (DefaultPluginManager.java:432) > >> at > >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals > >> (DefaultLifecycleExecutor.java:530) > >> ... 16 more > >> Caused by: java.lang.SecurityException: Prohibited package name: > >> java.lang > >> at java.lang.ClassLoader.preDefineClass(ClassLoader.java:479) > >> at java.lang.ClassLoader.defineClass(ClassLoader.java:614) > >> at java.security.SecureClassLoader.defineClass > >> (SecureClassLoader.java:124) > >> at java.net.URLClassLoader.defineClass(URLClassLoader.java: > >> 260) > >> at java.net.URLClassLoader.access$100(URLClassLoader.java:56) > >> at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > >> at java.security.AccessController.doPrivileged(Native Method) > >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > >> at > >> org.codehaus.plexus.compiler.javac.IsolatedClassLoader.loadClass > >> (IsolatedClassLoader.java:56) > >> at java.lang.ClassLoader.loadClassInternal > >> (ClassLoader.java:319) > >> at java.lang.ClassLoader.defineClass1(Native Method) > >> at java.lang.ClassLoader.defineClass(ClassLoader.java:620) > >> at java.security.SecureClassLoader.defineClass > >> (SecureClassLoader.java:124) > >> at java.net.URLClassLoader.defineClass(URLClassLoader.java: > >> 260) > >> at java.net.URLClassLoader.access$100(URLClassLoader.java:56) > >> at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > >> at java.security.AccessController.doPrivileged(Native Method) > >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > >> at > >> org.codehaus.plexus.compiler.javac.IsolatedClassLoader.loadClass > >> (IsolatedClassLoader.java:56) > >> at > >> org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess > >> (JavacCompiler.java:350) > >> at org.codehaus.plexus.compiler.javac.JavacCompiler.compile > >> (JavacCompiler.java:136) > >> at org.apache.maven.plugin.AbstractCompilerMojo.execute > >> (AbstractCompilerMojo.java:407) > >> ... 19 more > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [INFO] Total time: 5 seconds > >> [INFO] Finished at: Mon Dec 19 10:18:47 GMT 2005 > >> [INFO] Final Memory: 2M/6M > >> [INFO] > >> --------------------------------------------------------------------- > >> --- > >> ---- > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ mvn --version > >> Maven version: 2.0.1 > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ at org.apache.maven.cli.MavenCli.main(MavenCli.java:249) > >> bash: syntax error near unexpected token `(' > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ mvn --version > >> Maven version: 2.0.1 > >> [EMAIL PROTECTED] ~/scratch/maven/foo-bar] > >> $ java -version > >> java version "1.5.0_05" > >> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83) > >> Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing) > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]