Uploaded image for project: 'Continuum'
  1. Continuum
  2. CONTINUUM-2094

Release prepare should use MavenProject instead of Model

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.4 (Beta), 1.4.1
    • 1.5.0
    • None
    • Maven version: 2.0.10
      Java version: 1.5.0_17
      OS name: "linux" version: "2.6.28.7" arch: "i386" Family: "unix"
    • Patch

    Description

      When preparing a release, Continuum processes the pom to release based on the unprocessed org.apache.maven.model.Model. This leads to Continnum not supporting releases for a large set of poms. The attached patch updates the maven-release-manager dependency to the latest released version and additionally updates class ReleasePrepareAction to use org.apache.maven.project.MavenProjectBuilder for processing the pom to release.

      Attachments

        Issue Links

          Activity

            wsmoak Wendy Smoak added a comment -

            Consider patch for 1.3.x.

            (What version(s) does this actually affect? [...have you tested with?] They were all selected.)

            wsmoak Wendy Smoak added a comment - Consider patch for 1.3.x. (What version(s) does this actually affect? [...have you tested with?] They were all selected.)

            It affects all versions using an unprocessed org.apache.maven.model.Model instance for release preparation (which lacks all model processing performed by maven - inheritance, property substitutions, etc.). The patch was tested against trunk and the continuum-1.2.x branch.

            schulte77 Christian Schulte added a comment - It affects all versions using an unprocessed org.apache.maven.model.Model instance for release preparation (which lacks all model processing performed by maven - inheritance, property substitutions, etc.). The patch was tested against trunk and the continuum-1.2.x branch.
            wsmoak Wendy Smoak added a comment -

            Can you explain more about what this fixes? Maybe attach an example of a project that Continuum will not currently release, but that works after the patch? I'm not sure what you mean by "a large set of poms".

            wsmoak Wendy Smoak added a comment - Can you explain more about what this fixes? Maybe attach an example of a project that Continuum will not currently release, but that works after the patch? I'm not sure what you mean by "a large set of poms".

            Attached a simple example project. See stacktrace below. This example does not show the actual use case, but triggers the bug. Usecase: I have a parent with multiple modules. One of the modules happens to be a mojo. Some of the other modules are using that mojo. In the parent, I put a property holding the version of the mojo and also put that mojo in the parent's plugin management using that version property. The actual mojo pom then also uses that same property as its version. Without the patch, Continuum cannot prepare a release. Its just Continuum's prepare release action implementation - maven release manager supports such kind of pom since it uses the correct MavenProject instead of the unprocessed model. The patch makes Continuum's prepare release action behave the same as the maven release manager.

            code
            org.apache.maven.shared.release.versions.VersionParseException: Unable to parse the version string: "${module.version}"
            at org.apache.maven.shared.release.versions.DefaultVersionInfo.<init>(DefaultVersionInfo.java:156)
            at org.apache.maven.continuum.web.action.ReleasePrepareAction.setProperties(ReleasePrepareAction.java:333)
            at org.apache.maven.continuum.web.action.ReleasePrepareAction.processProject(ReleasePrepareAction.java:312)
            at org.apache.maven.continuum.web.action.ReleasePrepareAction.processProject(ReleasePrepareAction.java:316)
            at org.apache.maven.continuum.web.action.ReleasePrepareAction.input(ReleasePrepareAction.java:146)
            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 com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358)
            at com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:218)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:192)
            at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.intercept(ForceContinuumConfigurationInterceptor.java:72)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.redback.xwork.interceptor.PolicyEnforcementInterceptor.intercept(PolicyEnforcementInterceptor.java:149)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.redback.xwork.interceptor.SecureActionInterceptor.intercept(SecureActionInterceptor.java:178)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:58)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:174)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.webwork.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:169)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.redback.xwork.interceptor.AutoLoginInterceptor.intercept(AutoLoginInterceptor.java:156)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.redback.xwork.interceptor.ForceAdminUserInterceptor.intercept(ForceAdminUserInterceptor.java:76)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at org.codehaus.plexus.redback.xwork.interceptor.EnvironmentCheckInterceptor.intercept(EnvironmentCheckInterceptor.java:122)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
            at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
            at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:273)
            at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
            at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
            at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
            at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
            at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
            at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
            at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
            at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
            at org.mortbay.jetty.Server.handle(Server.java:324)
            at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
            at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
            code

            schulte77 Christian Schulte added a comment - Attached a simple example project. See stacktrace below. This example does not show the actual use case, but triggers the bug. Usecase: I have a parent with multiple modules. One of the modules happens to be a mojo. Some of the other modules are using that mojo. In the parent, I put a property holding the version of the mojo and also put that mojo in the parent's plugin management using that version property. The actual mojo pom then also uses that same property as its version. Without the patch, Continuum cannot prepare a release. Its just Continuum's prepare release action implementation - maven release manager supports such kind of pom since it uses the correct MavenProject instead of the unprocessed model. The patch makes Continuum's prepare release action behave the same as the maven release manager. code org.apache.maven.shared.release.versions.VersionParseException: Unable to parse the version string: "${module.version}" at org.apache.maven.shared.release.versions.DefaultVersionInfo.<init>(DefaultVersionInfo.java:156) at org.apache.maven.continuum.web.action.ReleasePrepareAction.setProperties(ReleasePrepareAction.java:333) at org.apache.maven.continuum.web.action.ReleasePrepareAction.processProject(ReleasePrepareAction.java:312) at org.apache.maven.continuum.web.action.ReleasePrepareAction.processProject(ReleasePrepareAction.java:316) at org.apache.maven.continuum.web.action.ReleasePrepareAction.input(ReleasePrepareAction.java:146) 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 com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358) at com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:218) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:192) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.intercept(ForceContinuumConfigurationInterceptor.java:72) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.redback.xwork.interceptor.PolicyEnforcementInterceptor.intercept(PolicyEnforcementInterceptor.java:149) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.redback.xwork.interceptor.SecureActionInterceptor.intercept(SecureActionInterceptor.java:178) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:58) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:174) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.webwork.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:169) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.redback.xwork.interceptor.AutoLoginInterceptor.intercept(AutoLoginInterceptor.java:156) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.redback.xwork.interceptor.ForceAdminUserInterceptor.intercept(ForceAdminUserInterceptor.java:76) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at org.codehaus.plexus.redback.xwork.interceptor.EnvironmentCheckInterceptor.intercept(EnvironmentCheckInterceptor.java:122) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:273) at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) code

            The attached example project is just one kind of pom not supported (correctly) by continuum. Another issue is the release plugin configuration when there is more than one inheritance level. For example:

            pom1 (holds release plugin configuration)
            pom2
            jar (release preparation cannot see the release plugin configuration from pom1)

            schulte77 Christian Schulte added a comment - The attached example project is just one kind of pom not supported (correctly) by continuum. Another issue is the release plugin configuration when there is more than one inheritance level. For example: pom1 (holds release plugin configuration) pom2 jar (release preparation cannot see the release plugin configuration from pom1)
            wsmoak Wendy Smoak added a comment -

            Example project added to the sandbox in r814049 - http://svn.apache.org/repos/asf/continuum/sandbox/examples/properties

            Confirmed in 1.3.4, release prepare fails as described.

            Needs to be tested in 1.4.x and the patch looked at to see if it will still apply to trunk.

            wsmoak Wendy Smoak added a comment - Example project added to the sandbox in r814049 - http://svn.apache.org/repos/asf/continuum/sandbox/examples/properties Confirmed in 1.3.4, release prepare fails as described. Needs to be tested in 1.4.x and the patch looked at to see if it will still apply to trunk.
            batkinson Brent Atkinson added a comment -

            Thank you for reporting. Confirmed this was still present using the supplied test, but changes in 1.4 invalidated the patch. Also, MavenProject building needed to use local repos for projects when configured.

            Fixed in r1661283

            batkinson Brent Atkinson added a comment - Thank you for reporting. Confirmed this was still present using the supplied test, but changes in 1.4 invalidated the patch. Also, MavenProject building needed to use local repos for projects when configured. Fixed in r1661283

            People

              batkinson Brent Atkinson
              schulte77 Christian Schulte
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: