You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Barrie Treloar (JIRA)" <ji...@codehaus.org> on 2011/06/27 10:02:42 UTC

[jira] Created: (MENFORCER-117) Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702

Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702
--------------------------------------------------------------------------------------------------

                 Key: MENFORCER-117
                 URL: https://jira.codehaus.org/browse/MENFORCER-117
             Project: Maven 2.x Enforcer Plugin
          Issue Type: Bug
          Components: Plugin
    Affects Versions: 1.0.1
         Environment: Windows XP
            Reporter: Barrie Treloar
            Priority: Critical
         Attachments: pom.xml

The pde-maven-plugin causes enforcer to NPE.

I've attached an IT pom.xml.
I haven't had time to investigate this any further than to get the IT to fail the same as my real build.

{noformat}
  <packaging>zip</packaging>

  <build>
    <plugins>
      <plugin>    
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>pde-maven-plugin</artifactId>
        <version>1.0-alpha-1</version>
        <extensions>true</extensions>
        <configuration>
           <buildProperties>
             <pdeProductFilename>example.product</pdeProductFilename>
           </buildProperties>
        </configuration>
        <!-- Also bind to mvn clean -->
        <executions>
          <execution>
            <id>clean-pde</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>        
      </plugin>
...
{noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MENFORCER-117) Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MENFORCER-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=302687#comment-302687 ] 

Barrie Treloar commented on MENFORCER-117:
------------------------------------------

Investigation shows:
Line 708 (was 702 prior to the start of hacking)
{noformat}
                plugin.setArtifactId( tokens[1] );
{noformat}

Dumping out what tokens is and some surrounding variables:

{noformat}
[ERROR] entry =clean=org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean
[ERROR] value =org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean
[ERROR] tokens =[org.apache.maven.plugins, maven-clean-plugin, 2.4.1, clean]
[ERROR] entry =install=org.apache.maven.plugins:maven-install-plugin:install
[ERROR] value =org.apache.maven.plugins:maven-install-plugin:install
[ERROR] tokens =[org.apache.maven.plugins, maven-install-plugin, install]
[ERROR] entry =generate-sources=
{noformat}

Likewise for the other test project being added
{noformat}
[ERROR] entry =integration-test=
[ERROR] value =
[ERROR] tokens =[]
{noformat}

So RequirePluginVersions needs to handle empty lifecycles.
                
> Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702
> --------------------------------------------------------------------------------------------------
>
>                 Key: MENFORCER-117
>                 URL: https://jira.codehaus.org/browse/MENFORCER-117
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.0.1
>         Environment: Windows XP
>            Reporter: Barrie Treloar
>            Assignee: Barrie Treloar
>            Priority: Critical
>         Attachments: pom.xml
>
>
> The pde-maven-plugin causes enforcer to NPE.
> I've attached an IT pom.xml.
> I haven't had time to investigate this any further than to get the IT to fail the same as my real build.
> {noformat}
>   <packaging>zip</packaging>
>   <build>
>     <plugins>
>       <plugin>    
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>pde-maven-plugin</artifactId>
>         <version>1.0-alpha-1</version>
>         <extensions>true</extensions>
>         <configuration>
>            <buildProperties>
>              <pdeProductFilename>example.product</pdeProductFilename>
>            </buildProperties>
>         </configuration>
>         <!-- Also bind to mvn clean -->
>         <executions>
>           <execution>
>             <id>clean-pde</id>
>             <phase>clean</phase>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>        
>       </plugin>
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MENFORCER-117) Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MENFORCER-117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barrie Treloar reassigned MENFORCER-117:
----------------------------------------

    Assignee: Barrie Treloar
    
> Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702
> --------------------------------------------------------------------------------------------------
>
>                 Key: MENFORCER-117
>                 URL: https://jira.codehaus.org/browse/MENFORCER-117
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.0.1
>         Environment: Windows XP
>            Reporter: Barrie Treloar
>            Assignee: Barrie Treloar
>            Priority: Critical
>         Attachments: pom.xml
>
>
> The pde-maven-plugin causes enforcer to NPE.
> I've attached an IT pom.xml.
> I haven't had time to investigate this any further than to get the IT to fail the same as my real build.
> {noformat}
>   <packaging>zip</packaging>
>   <build>
>     <plugins>
>       <plugin>    
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>pde-maven-plugin</artifactId>
>         <version>1.0-alpha-1</version>
>         <extensions>true</extensions>
>         <configuration>
>            <buildProperties>
>              <pdeProductFilename>example.product</pdeProductFilename>
>            </buildProperties>
>         </configuration>
>         <!-- Also bind to mvn clean -->
>         <executions>
>           <execution>
>             <id>clean-pde</id>
>             <phase>clean</phase>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>        
>       </plugin>
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MENFORCER-117) Custom Packaging with executions fails with ArrayIndexOutOfBoundsException in RequirePluginVersions.java:702

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MENFORCER-117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barrie Treloar updated MENFORCER-117:
-------------------------------------

    Fix Version/s: 1.2
          Summary: Custom Packaging with executions fails with ArrayIndexOutOfBoundsException in RequirePluginVersions.java:702  (was: Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702)
    
> Custom Packaging with executions fails with ArrayIndexOutOfBoundsException in RequirePluginVersions.java:702
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MENFORCER-117
>                 URL: https://jira.codehaus.org/browse/MENFORCER-117
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.0.1
>         Environment: Windows XP
>            Reporter: Barrie Treloar
>            Assignee: Barrie Treloar
>            Priority: Critical
>             Fix For: 1.2
>
>         Attachments: pom.xml
>
>
> The pde-maven-plugin causes enforcer to NPE.
> I've attached an IT pom.xml.
> I haven't had time to investigate this any further than to get the IT to fail the same as my real build.
> {noformat}
>   <packaging>zip</packaging>
>   <build>
>     <plugins>
>       <plugin>    
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>pde-maven-plugin</artifactId>
>         <version>1.0-alpha-1</version>
>         <extensions>true</extensions>
>         <configuration>
>            <buildProperties>
>              <pdeProductFilename>example.product</pdeProductFilename>
>            </buildProperties>
>         </configuration>
>         <!-- Also bind to mvn clean -->
>         <executions>
>           <execution>
>             <id>clean-pde</id>
>             <phase>clean</phase>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>        
>       </plugin>
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MENFORCER-117) Custom Packaging with executions fails with ArrayIndexOutOfBoundsException in RequirePluginVersions.java:702

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MENFORCER-117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barrie Treloar closed MENFORCER-117.
------------------------------------

    Resolution: Fixed

Did not take into account that lifecycles may have no plugins bound to them.
Also the formatting of some of the strings coming back included whitespace/newlines.
                
> Custom Packaging with executions fails with ArrayIndexOutOfBoundsException in RequirePluginVersions.java:702
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MENFORCER-117
>                 URL: https://jira.codehaus.org/browse/MENFORCER-117
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.0.1
>         Environment: Windows XP
>            Reporter: Barrie Treloar
>            Assignee: Barrie Treloar
>            Priority: Critical
>             Fix For: 1.2
>
>         Attachments: pom.xml
>
>
> The pde-maven-plugin causes enforcer to NPE.
> I've attached an IT pom.xml.
> I haven't had time to investigate this any further than to get the IT to fail the same as my real build.
> {noformat}
>   <packaging>zip</packaging>
>   <build>
>     <plugins>
>       <plugin>    
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>pde-maven-plugin</artifactId>
>         <version>1.0-alpha-1</version>
>         <extensions>true</extensions>
>         <configuration>
>            <buildProperties>
>              <pdeProductFilename>example.product</pdeProductFilename>
>            </buildProperties>
>         </configuration>
>         <!-- Also bind to mvn clean -->
>         <executions>
>           <execution>
>             <id>clean-pde</id>
>             <phase>clean</phase>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>        
>       </plugin>
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MENFORCER-117) Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702

Posted by "Barrie Treloar (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MENFORCER-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=302686#comment-302686 ] 

Barrie Treloar commented on MENFORCER-117:
------------------------------------------

Exception raised:
{noformat}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2-SNAPSHOT:enforce (test) on project pluginWithExtensions: Execution test of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2-SNAPSHOT:enforce failed: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2-SNAPSHOT:enforce (test) on project pluginWithExtensions: Execution test of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2-SNAPSHOT:enforce failed: 1
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution test of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2-SNAPSHOT:enforce failed: 1
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.maven.plugins.enforcer.RequirePluginVersions.getAllPlugins(RequirePluginVersions.java:708)
	at org.apache.maven.plugins.enforcer.RequirePluginVersions.getBoundPlugins(RequirePluginVersions.java:570)
	at org.apache.maven.plugins.enforcer.RequirePluginVersions.execute(RequirePluginVersions.java:201)
	at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:190)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

{noformat}

                
> Custom Packaging with executions fails with NullPointerException in RequirePluginVersions.java:702
> --------------------------------------------------------------------------------------------------
>
>                 Key: MENFORCER-117
>                 URL: https://jira.codehaus.org/browse/MENFORCER-117
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Bug
>          Components: Plugin
>    Affects Versions: 1.0.1
>         Environment: Windows XP
>            Reporter: Barrie Treloar
>            Assignee: Barrie Treloar
>            Priority: Critical
>         Attachments: pom.xml
>
>
> The pde-maven-plugin causes enforcer to NPE.
> I've attached an IT pom.xml.
> I haven't had time to investigate this any further than to get the IT to fail the same as my real build.
> {noformat}
>   <packaging>zip</packaging>
>   <build>
>     <plugins>
>       <plugin>    
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>pde-maven-plugin</artifactId>
>         <version>1.0-alpha-1</version>
>         <extensions>true</extensions>
>         <configuration>
>            <buildProperties>
>              <pdeProductFilename>example.product</pdeProductFilename>
>            </buildProperties>
>         </configuration>
>         <!-- Also bind to mvn clean -->
>         <executions>
>           <execution>
>             <id>clean-pde</id>
>             <phase>clean</phase>
>             <goals>
>               <goal>clean</goal>
>             </goals>
>           </execution>
>         </executions>        
>       </plugin>
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira