maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud Julienne (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MNG-2037) Strange NPE with profile and injectPlugins
Date Wed, 08 Mar 2006 16:41:23 GMT
    [ http://jira.codehaus.org/browse/MNG-2037?page=comments#action_60479 ] 

Renaud Julienne commented on MNG-2037:
--------------------------------------

I had the same issue and found a workaround.
In the profile build section, just add an empty pluginManagement section.

>From org.apache.maven.project.injection.DefaultProfileInjector
122             injectPlugins( profileBuild, modelBuild );
123 
124             // Plugin management :: aggregate
125             PluginManagement profilePM = profileBuild.getPluginManagement();  /** ==>
this is what leads to NullPointerException in the following injectPlugins call **/
126             PluginManagement modelPM = modelBuild.getPluginManagement();
127 
128             if ( modelPM == null )
129             {
130                 modelBuild.setPluginManagement( profilePM );
131             }
132             else
133             {
134                 injectPlugins( profilePM, modelPM );
135             }

> Strange NPE with profile and injectPlugins
> ------------------------------------------
>
>          Key: MNG-2037
>          URL: http://jira.codehaus.org/browse/MNG-2037
>      Project: Maven 2
>         Type: Bug

>     Versions: 2.0.2
>  Environment: solaris and windowns
>     Reporter: Olivier Lamy
>     Assignee: John Casey
>     Priority: Blocker
>      Fix For: 2.0.3
>  Attachments: fullstack.log, pom_changeip.xml
>
>
> I use the war plugin with a default configuration :
> <plugin>
>   <artifactId>maven-war-plugin</artifactId>
>   <configuration>
>     <warSourceDirectory implementation="java.io.File">${basedir}/src/main/web</warSourceDirectory>
>     <webXml>${basedir}/src/main/resources/war/web.xml</webXml> 
>     <webappDirectory implementation="java.io.File">${basedir}/webappdir</webappDirectory>
>   </configuration>
> </plugin> 
> And a profile with only 
>     <profile>
>       <id>rec-ap2</id>
>       <build>
>         <plugins>
>           <plugin>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>               <webappDirectory implementation="java.io.File">/local/tomcat/jakarta-tomcat-5.5.9/webapps/SLSTester</webappDirectory>
>             </configuration>
>           </plugin>
>         </plugins> 
>       </build>     
>     </profile>
> mvn -P rec-ap2 -X -e war:exploded generate the NPE :
> + Error stacktraces are turned on. 
> [DEBUG] Building Maven user-level plugin registry from: '/local/tomcat/.m2/plugin-registry.xml'

> [DEBUG] Building Maven global-level plugin registry from: '/local/maven/maven-2.0.2/conf/plugin-registry.xml'

> [INFO] Scanning for projects... 
> [INFO] ---------------------------------------------------------------------------- 
> [ERROR] FATAL ERROR 
> [INFO] ---------------------------------------------------------------------------- 
> [INFO] null 
> [INFO] ---------------------------------------------------------------------------- 
> [DEBUG] Trace 
> java.lang.NullPointerException 
>         at org.apache.maven.project.injection.DefaultProfileInjector.injectPlugins(DefaultProfileInjector.java:147)

>         at org.apache.maven.project.injection.DefaultProfileInjector.injectBuild(DefaultProfileInjector.java:134)

>         at org.apache.maven.project.injection.DefaultProfileInjector.inject(DefaultProfileInjector.java:80)

>         at org.apache.maven.project.DefaultMavenProjectBuilder.injectActiveProfiles(DefaultMavenProjectBuilder.java:1035)
>         at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:836)

>         at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:593)

>         at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(DefaultMavenProjectBuilder.java:303)

>         at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:274)

>         at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:515) 
>         at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:447) 
>         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:351) 
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:278) 
>         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) 
> [INFO] ---------------------------------------------------------------------------- 
> [INFO] Total time: < 1 second 
> [INFO] Finished at: Fri Feb 03 23:39:41 MET 2006 
> [INFO] Final Memory: 2M/126M 
> [INFO] ---------------------------------------------------------------------------- 

-- 
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


Mime
View raw message