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

Nullpointerexception when executing project containing a profile

Hi

Continuum (1.0.3) was working fine with my project until I introduced 
profiles in the pom.xml.
I updated the Build Definition Arguments to" -P <profilename> 
--batch-mode --non-recursive" and since then I get the following Result 
output from Continuum:
*****
[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)
*****

With the exact same parameters maven2 (2.0.4) build just fine on the 
commandline:
"mvn -P <profilename> --batch-mode --non-recursive clean package"

what could be the problem

the profile looks like:
***
<profiles>
     <profile>
       <id>aaa</id>
       <activation>
         <property>
           <name>env</name>
           <value>aaa<value>
         </property>
       </activation>
       <build>
         <filters>
           <filter>${basedir}/rsrc/env_pan.properties</filter>
         </filters>
       </build>
     </profile>
     <profile>
       <id>bbb</id>
       <activation>
         <property>
           <name>env</name>
           <value>bbb</value>
         </property>
       </activation>
       <build>
         <filters>
           <filter>${basedir}/rsrc/env_nca.properties</filter>
         </filters>
       </build>
     </profile>
   </profiles>
***

best regards
Daniel

P.S.
I get the exact same Exception when doing a release:prepare on the 
commandline - I guess there is a connection to this issue...

Re: Nullpointerexception when executing project containing a profile

Posted by Daniel Schaedler <li...@daniel.schaedler.name>.
Hi John

thanks for the reply

John Casey wrote:
> I've looked around in the current SVN for Maven (this chunk of code hasn't
> changed much, I don't think), and I'm not seeing any way that your NPE 
> could
> arise.
> 
> Can you tell me which Maven version your instance of Continuum is using?
> That way, I can checkout the code from that release, and see whether I can
> replicate the problem. You mentioned that this problem doesn't occur when
> you build using Maven 2.0.4 from the command line...are you certain that
> Continuum is using this version?

All I can see is, that Continuum uses maven_XXX-2.0.4.jars (found in 
.../continuum-1.0.3/apps/continuum/lib/ )
I installed Continuum (1.0.3) again today -> same result (just to be 
sure that nothing has changed since March).

Daniel

> Thanks,
> 
> -john
> 
> On 7/26/06, Daniel Schaedler <li...@daniel.schaedler.name> wrote:
>>
>> Hi
>>
>> Continuum (1.0.3) was working fine with my project until I introduced
>> profiles in the pom.xml.
>> I updated the Build Definition Arguments to" -P <profilename>
>> --batch-mode --non-recursive" and since then I get the following Result
>> output from Continuum:
>> *****
>> [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)
>> *****
>>
>> With the exact same parameters maven2 (2.0.4) build just fine on the
>> commandline:
>> "mvn -P <profilename> --batch-mode --non-recursive clean package"
>>
>> what could be the problem
>>
>> the profile looks like:
>> ***
>> <profiles>
>>      <profile>
>>        <id>aaa</id>
>>        <activation>
>>          <property>
>>            <name>env</name>
>>            <value>aaa<value>
>>          </property>
>>        </activation>
>>        <build>
>>          <filters>
>>            <filter>${basedir}/rsrc/env_pan.properties</filter>
>>          </filters>
>>        </build>
>>      </profile>
>>      <profile>
>>        <id>bbb</id>
>>        <activation>
>>          <property>
>>            <name>env</name>
>>            <value>bbb</value>
>>          </property>
>>        </activation>
>>        <build>
>>          <filters>
>>            <filter>${basedir}/rsrc/env_nca.properties</filter>
>>          </filters>
>>        </build>
>>      </profile>
>>    </profiles>
>> ***
>>
>> best regards
>> Daniel
>>
>> P.S.
>> I get the exact same Exception when doing a release:prepare on the
>> commandline - I guess there is a connection to this issue...
>>
> 


Re: Nullpointerexception when executing project containing a profile

Posted by John Casey <ca...@gmail.com>.
Hi Daniel,

I've looked around in the current SVN for Maven (this chunk of code hasn't
changed much, I don't think), and I'm not seeing any way that your NPE could
arise.

Can you tell me which Maven version your instance of Continuum is using?
That way, I can checkout the code from that release, and see whether I can
replicate the problem. You mentioned that this problem doesn't occur when
you build using Maven 2.0.4 from the command line...are you certain that
Continuum is using this version?

Thanks,

-john

On 7/26/06, Daniel Schaedler <li...@daniel.schaedler.name> wrote:
>
> Hi
>
> Continuum (1.0.3) was working fine with my project until I introduced
> profiles in the pom.xml.
> I updated the Build Definition Arguments to" -P <profilename>
> --batch-mode --non-recursive" and since then I get the following Result
> output from Continuum:
> *****
> [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)
> *****
>
> With the exact same parameters maven2 (2.0.4) build just fine on the
> commandline:
> "mvn -P <profilename> --batch-mode --non-recursive clean package"
>
> what could be the problem
>
> the profile looks like:
> ***
> <profiles>
>      <profile>
>        <id>aaa</id>
>        <activation>
>          <property>
>            <name>env</name>
>            <value>aaa<value>
>          </property>
>        </activation>
>        <build>
>          <filters>
>            <filter>${basedir}/rsrc/env_pan.properties</filter>
>          </filters>
>        </build>
>      </profile>
>      <profile>
>        <id>bbb</id>
>        <activation>
>          <property>
>            <name>env</name>
>            <value>bbb</value>
>          </property>
>        </activation>
>        <build>
>          <filters>
>            <filter>${basedir}/rsrc/env_nca.properties</filter>
>          </filters>
>        </build>
>      </profile>
>    </profiles>
> ***
>
> best regards
> Daniel
>
> P.S.
> I get the exact same Exception when doing a release:prepare on the
> commandline - I guess there is a connection to this issue...
>

Re: Perforce-continuum related issues

Posted by Emmanuel Venisse <em...@venisse.net>.

Prashanth Krishnamurthy a écrit :
> Couple Questions - 
> 
> 1. when we do a build in continuum, what perforce
> commands is it executing ? Which file has this
> configuration ? ( using perforce-->maven->continuum ).
> 
> 2. IN continuum, why don’t the children projects get
> built when you build the parent project? 
> 

By default, mvn run with -N parameter (non recursive). If you want to build sub-modules in the same 
build of the parent, you can remove this parameter in the build definition in continuum.

Emmanuel


Perforce-continuum related issues

Posted by Prashanth Krishnamurthy <pk...@yahoo.com>.
Couple Questions - 

1. when we do a build in continuum, what perforce
commands is it executing ? Which file has this
configuration ? ( using perforce-->maven->continuum ).

2. IN continuum, why don’t the children projects get
built when you build the parent project? 

thanks
--Prashanth

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com