You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by mcculls <gi...@git.apache.org> on 2016/01/06 12:40:21 UTC

[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

GitHub user mcculls opened a pull request:

    https://github.com/apache/maven/pull/77

    [MNG-5958] restore binary compatibility of Lifecycle.setPhases

    https://issues.apache.org/jira/browse/MNG-5958
    
    While MNG-5805 restored binary compatibility of Lifecycle.getPhases it didn't do the same for Lifecycle.setPhases. This breaks plugins like flexmojos-maven-plugin which have their own lifecycle mapping implementations.
    
    The following pom.xml demonstrates the issue:
    ```
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
    
      <groupId>org.example</groupId>
      <artifactId>mng-958</artifactId>
      <version>1.0</version>
    
      <packaging>swf</packaging>
    
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.flexmojos</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <version>4.0-RC2</version>
            <extensions>true</extensions>
          </plugin>
        </plugins>
      </build>
    
    </project>
    ```
    Using "mvn validate" with Maven 3.3.9 you get the following exception:
    ```
    [INFO] Scanning for projects...
    [ERROR] Internal error: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase -> [Help 1]
    org.apache.maven.InternalErrorException: Internal error: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase
    	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
    	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:497)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase
    	at org.apache.maven.lifecycle.internal.DefaultLifecyclePluginAnalyzer.getPluginsBoundByDefaultToAllLifecycles(DefaultLifecyclePluginAnalyzer.java:119)
    	at org.apache.maven.model.plugin.DefaultLifecycleBindingsInjector.injectLifecycleBindings(DefaultLifecycleBindingsInjector.java:64)
    	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:451)
    	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:421)
    	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:620)
    	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:411)
    	at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
    	at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
    	at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
    	at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
    	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
    	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    	... 11 more
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
    ```
    With Maven 3.3.3 this exception doesn't occur.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mcculls/maven MNG-5958-restore-lifecycle-setphases-compatibility

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven/pull/77.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #77
    
----
commit c09717ebf6c69142fd0b8c09dc59585b77b49a47
Author: Stuart McCulloch <mc...@gmail.com>
Date:   2016-01-06T11:23:06Z

    [MNG-5958] restore binary compatibility of Lifecycle.setPhases
    
    While MNG-5805 restored binary compatibility of Lifecycle.getPhases
    it didn't do the same for Lifecycle.setPhases. This breaks plugins
    like flexmojos-maven-plugin which have their own lifecycle mapping
    implementations.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by jvanzyl <gi...@git.apache.org>.
Github user jvanzyl commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169376675
  
    @michael-o +1, thanks very much!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by atanasenko <gi...@git.apache.org>.
Github user atanasenko commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169332865
  
    @michael-o, @mcculls I can also assist with tests


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by michael-o <gi...@git.apache.org>.
Github user michael-o commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169481891
  
    Great, I will wait for the ITs and try both and merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by atanasenko <gi...@git.apache.org>.
Github user atanasenko commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169636108
  
    This change actually breaks MNG-5805 test since plexus can no longer call setPhases with Lifecycle map. However, I think changing the functionality (and test) to use <lifecyclePhases> is safe since this feature was not announced much and nobody's using it. I haven't got to using it either, so..
    
    I've created a pull request with positive/negative ITs for this issue as well as a change to MNG-5805 IT:
    https://github.com/apache/maven-integration-testing/pull/13


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by mcculls <gi...@git.apache.org>.
Github user mcculls commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169349800
  
    @atanasenko thanks, that would be helpful


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by atanasenko <gi...@git.apache.org>.
Github user atanasenko commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169321926
  
    +1
    Turns out people do use this method..
    Stuart, thanks for fixing!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/maven/pull/77


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by michael-o <gi...@git.apache.org>.
Github user michael-o commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169331588
  
    @mcculls It would be great if you could an IT to the Core IT Suite. A negative and positive one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by michael-o <gi...@git.apache.org>.
Github user michael-o commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169331471
  
    @jvanzyl This looks like a safe merge. I would pull if you don't mind.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] maven pull request: [MNG-5958] restore binary compatibility of Lif...

Posted by michael-o <gi...@git.apache.org>.
Github user michael-o commented on the pull request:

    https://github.com/apache/maven/pull/77#issuecomment-169349132
  
    @atanasenko  Давай, спасибо!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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