Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.2
    • Component/s: None
    • Labels:
      None

      Description

      With maven 3, build fails.
      It seems like that jetspeed-unpack-maven-plugin:2.2.1:unpack doesn't work with maven 3.
      Also, it has been recommended to replace "pom.version" by "project.version".

      Full stacktraces are like the following (excerpted from the Jetspeed user mailinglist):

      > From: 韩宜宗 <lyhanyz@gmail.com>
      > Subject: Re: Maven 3.0.1 supported ?
      > To: "Jetspeed Users List" <jetspeed-user@portals.apache.org>
      > Date: Wednesday, December 22, 2010, 4:00 PM
      > d:\12-Code\Portal>mvn -version
      > Apache Maven 3.0.1 (r1038046; 2010-11-23 18:58:32+0800)
      > Java version: 1.6.0_22
      > Java home: c:\Program Files\Java\jdk1.6.0_22\jre
      > Default locale: zh_CN, platform encoding: GBK
      > OS name: "windows 7" version: "6.1" arch: "amd64" Family:
      > "windows"
      > *d:\12-Code\Portal>mvn
      > org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-*
      > *4:generate
      > -DarchetypeGroupId=org.apache.portals.jetspeed-2
      > -DarchetypeArtifactI*
      > *d=jetspeed-archetype -DarchetypeVersion=2.2.1
      > -DartifactId=jetexpress
      > -Dpackage=*
      > *org.apache.portals.tutorials
      > -DgroupId=org.apache.portals.tutorials
      > -Dversion=1.*
      > 0-SNAPSHOT
      > [INFO] Scanning for projects...
      > [INFO]
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Building Maven Stub Project (No POM) 1
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO]
      > [INFO] >>>
      > maven-archetype-plugin:2.0-alpha-4:generate (default-cli) @
      > standalon
      > e-pom >>>
      > [INFO]
      > [INFO] <<<
      > maven-archetype-plugin:2.0-alpha-4:generate (default-cli) @
      > standalon
      > e-pom <<<
      > [INFO]
      > [INFO] — maven-archetype-plugin:2.0-alpha-4:generate
      > (default-cli) @
      > standalon
      > e-pom —
      > [INFO] Setting property: classpath.resource.loader.class
      > =>
      > 'org.codehaus.plexus
      > .velocity.ContextClassLoaderResourceLoader'.
      > [INFO] Setting property: velocimacro.messages.on =>
      > 'false'.
      > [INFO] Setting property: resource.loader =>
      > 'classpath'.
      > [INFO] Setting property: resource.manager.logwhenfound
      > => 'false'.
      > [INFO] Generating project in Interactive mode
      > [WARNING] No archetype repository found. Falling back to
      > central repository
      > (htt
      > p://repo1.maven.org/maven2).
      > [WARNING] Use -DarchetypeRepository=<your repository>
      > if archetype's
      > repository
      > is elsewhere.
      > Confirm properties configuration:
      > groupId: org.apache.portals.tutorials
      > artifactId: jetexpress
      > version: 1.0-SNAPSHOT
      > package: org.apache.portals.tutorials
      > Y: : y
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] BUILD SUCCESS
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Total time: 6.367s
      > [INFO] Finished at: Wed Dec 22 22:55:47 CST 2010
      > [INFO] Final Memory: 7M/77M
      > [INFO]
      > ------------------------------------------------------------------------
      > d:\12-Code\Portal>cd jetexpress
      > *
      > *
      > d:\12-Code\Portal\jetexpress>mvn install
      > [INFO] Scanning for projects...
      > [WARNING]
      > [WARNING] Some problems were encountered while building the
      > effective model
      > for
      > org.apache.portals.tutorials:jetexpress-portal:war:1.0-SNAPSHOT
      > [WARNING] 'build.plugins.plugin.version' for
      > org.apache.maven.plugins:maven-war-
      > plugin is missing. @ line 163, column 15
      > [WARNING] The expression $

      {pom.artifactId}

      is deprecated.
      > Please use
      > $

      {project.a > rtifactId}

      instead.
      > [WARNING]
      > [WARNING] It is highly recommended to fix these problems
      > because they
      > threaten t
      > he stability of your build.
      > [WARNING]
      > [WARNING] For this reason, future Maven versions might no
      > longer support
      > buildin
      > g such malformed projects.
      > [WARNING]
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Reactor Build Order:
      > [INFO]
      > [INFO] jetexpress portal project
      > [INFO] jetexpress portal
      > [INFO] jetexpress portlet application
      > [INFO]
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Building jetexpress portal project 1.0-SNAPSHOT
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO]
      > [INFO] — maven-install-plugin:2.3.1:install
      > (default-install) @ jetexpress
      > —
      >
      > [INFO] Installing d:\12-Code\Portal\jetexpress\pom.xml to
      > d:\92-VM\share\maven\.
      > m2\repository\org\apache\portals\tutorials\jetexpress\1.0-SNAPSHOT\jetexpress-1.
      > 0-SNAPSHOT.pom
      > [INFO]
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Building jetexpress portal 1.0-SNAPSHOT
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO]
      > [INFO] — jetspeed-unpack-maven-plugin:2.2.1:unpack
      > (unpack-jetspeed-properties
      > ) @ jetexpress-portal —
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Reactor Summary:
      > [INFO]
      > [INFO] jetexpress portal project .........................
      > SUCCESS [0.713s]
      > [INFO] jetexpress portal .................................
      > FAILURE [2.202s]
      > [INFO] jetexpress portlet application ....................
      > SKIPPED
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] BUILD FAILURE
      > [INFO]
      > ------------------------------------------------------------------------
      > [INFO] Total time: 3.296s
      > [INFO] Finished at: Wed Dec 22 22:56:04 CST 2010
      > [INFO] Final Memory: 13M/175M
      > [INFO]
      > ------------------------------------------------------------------------
      > [ERROR] Failed to execute goal
      > org.apache.portals.jetspeed-2:jetspeed-unpack-mav
      > en-plugin:2.2.1:unpack (unpack-jetspeed-properties) on
      > project
      > jetexpress-portal
      > : unpack artifact
      > org.apache.portals.jetspeed-2:jetspeed-portal-resources:jar
      > no
      > t defined as plugin dependency -> [Help 1]
      > [ERROR]
      > [ERROR] To see the full stack trace of the errors, re-run
      > Maven with the -e
      > swit
      > ch.
      > [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
      > rea
      > d the following articles:
      > [ERROR] [Help 1]
      > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
      > xception
      > [ERROR]
      > [ERROR] After correcting the problems, you can resume the
      > build with the
      > command
      >
      > [ERROR]   mvn <goals> -rf
      > :jetexpress-portal
      > d:\12-Code\Portal\jetexpress>
      >
      >
      > 2010/12/14 Ron Wheeler <rwheeler@artifact-software.com>
      >
      > > On 12/12/2010 7:23 AM, Jeroen van der Meer sr. wrote:
      > >
      > >> L.S.
      > >>
      > >> I have tried to follow the tutorial ( Jetspeed
      > 2.2.1 ) to create a portal.
      > >> The buildprocess gave an error when i used maven
      > 3.0.1
      > >>
      > > What error. Did you ask about this on the Maven list?
      > >
      > >  When i used maven 2.0.9 there was no problem.
      > >>
      > >
      > >
      > >> Will maven 3.0.1+ be supported in jetspeed 2.2.2
      > ?
      > >>
      > >> With regards,
      > >>
      > >> Jeroen van der Meer
      > >>
      > >>

        Activity

        Hide
        Ate Douma added a comment -

        All of Jetspeed-2 as well as portals bridges and portals applications build fine now with maven-3 (tested against latest 3.0.3)

        Show
        Ate Douma added a comment - All of Jetspeed-2 as well as portals bridges and portals applications build fine now with maven-3 (tested against latest 3.0.3)
        Hide
        Ate Douma added a comment -

        I determined the problem why the jetspeed-mvn:unpack plugin fails with Maven 3.
        In the unpack plugin (and the others), it used the Maven PluginDescriptor.getIntroducedDependencyArtifacts() method to retrieve dependencies configured for the plugin itself only.
        That allowed an convenience usage of the plugin when only a single dependency (artifact) was defined as it then could determine itself automatically which artifact that was.
        However, although this method is still defined on the Maven PluginDescriptor, Maven 3 now simply always returns an EMPTY_COLLECTION. So much for backwards compatibility ...

        As result, I had to refactor the plugins who relied on this method to fallback to the PluginDescriptor.getArtifacts() method. Which does return all dependencies within scope, so not just the one explicitly defined for the plugin.
        And, the convenience usage of not having to specify the artifact to unpack if only one is defined no longer is possible!
        Meaning: every unpack configuration now either has to specify an <artifact>$

        {groupId}

        :$

        {artifactId}

        :$

        {packaging}

        </artifact> or a <file>[file location]</file> element.
        Other than making the required configuration changes for this, Jetspeed-2 portal trunk then builds with maven 3 just fine.
        I've already committed the needed changes.

        I'll keep this issue open however as so far I only ensured the jetspeed-2 portal project is now building fine with Maven 3 again.
        The other jetspeed-2 applications projects like j2-admin also needs to be checked and if needed cleaned up/fixed, something which I'll look into later this week or next week.

        Show
        Ate Douma added a comment - I determined the problem why the jetspeed-mvn:unpack plugin fails with Maven 3. In the unpack plugin (and the others), it used the Maven PluginDescriptor.getIntroducedDependencyArtifacts() method to retrieve dependencies configured for the plugin itself only. That allowed an convenience usage of the plugin when only a single dependency (artifact) was defined as it then could determine itself automatically which artifact that was. However, although this method is still defined on the Maven PluginDescriptor, Maven 3 now simply always returns an EMPTY_COLLECTION. So much for backwards compatibility ... As result, I had to refactor the plugins who relied on this method to fallback to the PluginDescriptor.getArtifacts() method. Which does return all dependencies within scope, so not just the one explicitly defined for the plugin. And, the convenience usage of not having to specify the artifact to unpack if only one is defined no longer is possible! Meaning: every unpack configuration now either has to specify an <artifact>$ {groupId} :$ {artifactId} :$ {packaging} </artifact> or a <file> [file location] </file> element. Other than making the required configuration changes for this, Jetspeed-2 portal trunk then builds with maven 3 just fine. I've already committed the needed changes. I'll keep this issue open however as so far I only ensured the jetspeed-2 portal project is now building fine with Maven 3 again. The other jetspeed-2 applications projects like j2-admin also needs to be checked and if needed cleaned up/fixed, something which I'll look into later this week or next week.

          People

          • Assignee:
            Ate Douma
            Reporter:
            Woonsan Ko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development