You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daniel Schaedler <li...@daniel.schaedler.name> on 2006/07/25 08:15:11 UTC

NPE with release-plugin and profile

Hi

I get a Nullpointerexception when executing a release:prepare and using 
a profile: (using Maven 2.0.4)

 > mvn -P <profilename> clean release:prepare
(....downloding...)
[INFO] [release:prepare]
[INFO] Resuming release from phase 'run-preparation-goals'
[INFO] Executing preparation goals 'clean integration-test'...
[INFO] Executing: mvn clean integration-test --no-plugin-updates -P 
<profilename>
     [INFO] Scanning for projects...
     [INFO] 
----------------------------------------------------------------------------
     [ERROR] FATAL ERROR
     [INFO] 
----------------------------------------------------------------------------
     [INFO] null
     [INFO] 
----------------------------------------------------------------------------
     [INFO] 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:998)
         at 
org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:828)
         at 
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:586)
         at 
org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFile(DefaultMavenProjectBuilder.java:298)
         at 
org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:276)
         at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:509)
         at 
org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
         at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:345)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:276)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
         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)

***************
I can execute the last goal "mvn clean integration-test 
--no-plugin-updates -P <profilename>" manually and it works.
I can also use release:prepare with no profile and it works.

Any ideas?

best regards
Daniel



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


Re: NPE with release-plugin and profile

Posted by Daniel Schaedler <li...@daniel.schaedler.name>.
Thanks Denis for the reply

Denis Cabasson wrote:
> 
> Daniel Schaedler wrote:
>> Hi
>>
>> I get a Nullpointerexception when executing a release:prepare and using 
>> a profile: (using Maven 2.0.4)
>>
> 
> Does your profile attach a specific plugin to any lifecycle goal?

no, the only plugin configured in the pom is the maven-compiler-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>

and I use wagon-ftp as an extension.

> Such errors commonly comes from mispelled groupId/artifactId plugins
> attached to the build lifecycle.

But for almost all other goals than the release I get a successful build 
(compile, test, package, deploy, ...)

> Can you show us the content of your profile?

sure:
   <profiles>
     <profile>
       <id>pan</id>
       <activation>
         <property>
           <name>env</name>
           <value>aaa</value>
         </property>
       </activation>
       <build>
         <filters>
           <filter>${basedir}/rsrc/env_aaa.properties</filter>
         </filters>
       </build>
     </profile>
     <profile>
       <id>nca</id>
       <activation>
         <property>
           <name>env</name>
           <value>bbb</value>
         </property>
       </activation>
       <build>
         <filters>
           <filter>${basedir}/rsrc/env_bbb.properties</filter>
         </filters>
       </build>
     </profile>
   </profiles>



Daniel


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


Re: NPE with release-plugin and profile

Posted by Denis Cabasson <de...@insee.fr>.

Daniel Schaedler wrote:
> 
> Hi
> 
> I get a Nullpointerexception when executing a release:prepare and using 
> a profile: (using Maven 2.0.4)
> 

Does your profile attach a specific plugin to any lifecycle goal?

Such errors commonly comes from mispelled groupId/artifactId plugins
attached to the build lifecycle.

Can you show us the content of your profile?

Denis.
-- 
View this message in context: http://www.nabble.com/NPE-with-release-plugin-and-profile-tf1996576.html#a5481211
Sent from the Maven - Users forum at Nabble.com.


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