Jetspeed 2
  1. Jetspeed 2
  2. JS2-978

In jetspeed-deploy-maven-plugin, cannot use expand or infuse when having a targetName

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Component/s: Deployment
    • Labels:
      None

      Description

      When using a targetName on a deployment for the maven deploy plugin, the expand and infuse elements cannot be used. The expand element will create a expanded directory by the name of the targetname including extention (so a demo.war directory in the example, which should be just demo). The infuse element leads to a nullpointer while creating a temp file (see stacktrace).

      Example:
      <deployment>
      <artifact>org.apache.portals.applications:apa-demo:war</artifact>
      <targetName>demo.war</targetName>
      <expand>true</expand>
      <infuse>true</infuse>
      <delete>./demo</delete>
      </deployment>

      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to infuse C:\Maven2\org\apache\portal
      s\applications\apa-demo\1.0-SNAPSHOT\apa-demo-1.0-SNAPSHOT.war
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor
      .java:583)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifec
      ycleExecutor.java:499)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.
      java:478)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultL
      ifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleE
      xecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java
      :142)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
      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)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to infuse C:\Maven2\org\apache\por
      tals\applications\apa-demo\1.0-SNAPSHOT\apa-demo-1.0-SNAPSHOT.war
      at org.apache.jetspeed.maven.plugins.DeployMojo.execute(DeployMojo.java:438)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor
      .java:558)
      ... 16 more
      Caused by: java.lang.NullPointerException
      at java.io.File.createTempFile(File.java:1421)
      at java.io.File.createTempFile(File.java:1471)
      at org.apache.jetspeed.tools.deploy.JetspeedDeploy.<init>(JetspeedDeploy.java:109)
      at org.apache.jetspeed.tools.deploy.JetspeedDeployFactory.getInstance(JetspeedDeployFactory.
      java:58)
      at org.apache.jetspeed.maven.plugins.DeployMojo.execute(DeployMojo.java:433)
      ... 18 more

        Activity

        Hide
        David Sean Taylor added a comment -

        Woonsan could you review and discuss with Jeroen?

        Show
        David Sean Taylor added a comment - Woonsan could you review and discuss with Jeroen?
        Hide
        David Sean Taylor added a comment -

        updating target version

        Show
        David Sean Taylor added a comment - updating target version
        Hide
        Randy Watler added a comment -

        Both expand and infuse options are now used successfully as part of the main installer and demo application builds.

        Infusion was apparently fixed in commit 771625 by Ate.

        Show
        Randy Watler added a comment - Both expand and infuse options are now used successfully as part of the main installer and demo application builds. Infusion was apparently fixed in commit 771625 by Ate.
        Hide
        Jeroen Hoffman added a comment -

        Are you sure about the expand? I don't see the expand element beiing used in jetspeed-installer/jetspeed-mvn-tomcat-portal-pom.xml

        Show
        Jeroen Hoffman added a comment - Are you sure about the expand? I don't see the expand element beiing used in jetspeed-installer/jetspeed-mvn-tomcat-portal-pom.xml
        Hide
        Randy Watler added a comment -

        Have verified expand deployment in applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml, but the original issue was reported against jetspeed-installer/jetspeed-mvn-tomcat-portal-pom.xml. Verifying expand operation in the installer.

        Show
        Randy Watler added a comment - Have verified expand deployment in applications/jetspeed-demo/jetspeed-mvn-demo-pom.xml, but the original issue was reported against jetspeed-installer/jetspeed-mvn-tomcat-portal-pom.xml. Verifying expand operation in the installer.
        Hide
        Randy Watler added a comment -

        I have tested the installer build in the J2 2.2 build and have verified that jetspeed-mvn-tomcat-portal-pom.xml invocations of jetspeed-deploy-maven-plugin is indeed honoring the expand and infuse configuration tags:

        [INFO] [jetspeed-deploy:deploy

        {execution: deploy}

        ]
        [INFO] Deploying to targetBaseDir /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18
        [INFO] deploying to lib: portlet-api-2.0.jar
        [INFO] deploying to lib: ccpp-1.0.jar
        [INFO] deploying to lib: jetspeed-api-2.2-SNAPSHOT.jar
        [INFO] deploying to lib: jetspeed-commons-2.2-SNAPSHOT.jar
        [INFO] deploying to lib: pluto-container-api-2.0.0-SNAPSHOT.jar
        [INFO] deploying to lib: pluto-taglib-2.0.0-SNAPSHOT.jar
        [INFO] deploying to lib: portals-bridges-common-1.0.4.jar
        [INFO] deploying to war: jetspeed (expanded)
        [INFO] deploying to context: context.xml
        [INFO] deploying to war: j2-admin (expanded)
        [INFO] deploying to war: demo.war (infused)
        Found web.xml
        Found WEB-INF/portlet.xml
        Attempting to add portlet.tld to war...
        Adding portlet.tld to war...
        Creating war /tmp/apa-demo-1.0-SNAPSHOT.war.infused-28902 ...
        War /tmp/apa-demo-1.0-SNAPSHOT.war.infused-28902 created
        [INFO] deploying to war: rss.war (infused)
        Found web.xml
        Found WEB-INF/portlet.xml
        Attempting to add portlet.tld to war...
        Adding portlet.tld to war...
        Creating war /tmp/apa-rss-war-1.0-SNAPSHOT.war.infused-28904 ...
        War /tmp/apa-rss-war-1.0-SNAPSHOT.war.infused-28904 created
        [INFO] deploying to war: webcontent.war (infused)
        Found web.xml
        Found WEB-INF/portlet.xml
        Attempting to add portlet.tld to war...
        Adding portlet.tld to war...
        Creating war /tmp/apa-webcontent-war-1.0-SNAPSHOT.war.infused-28906 ...
        War /tmp/apa-webcontent-war-1.0-SNAPSHOT.war.infused-28906 created

        Here is a listing of the target deployment directory:

        > ls -l /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18/webapps/
        total 16680
        rw-rw-r- 1 rwatler rwatler 7956188 2009-05-11 12:18 demo.war
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:18 host-manager/
        drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:18 j2-admin/
        drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:18 jetspeed/
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:18 manager/
        drwxrwxr-x 3 rwatler rwatler 4096 2009-05-11 12:18 ROOT/
        rw-rw-r- 1 rwatler rwatler 4860899 2009-05-11 12:18 rss.war
        rw-rw-r- 1 rwatler rwatler 4208046 2009-05-11 12:18 webcontent.war

        j2-admin and jetspeed are both expanded and demo, rss, and webcontent have been infused and deployed as wars.

        Show
        Randy Watler added a comment - I have tested the installer build in the J2 2.2 build and have verified that jetspeed-mvn-tomcat-portal-pom.xml invocations of jetspeed-deploy-maven-plugin is indeed honoring the expand and infuse configuration tags: [INFO] [jetspeed-deploy:deploy {execution: deploy} ] [INFO] Deploying to targetBaseDir /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18 [INFO] deploying to lib: portlet-api-2.0.jar [INFO] deploying to lib: ccpp-1.0.jar [INFO] deploying to lib: jetspeed-api-2.2-SNAPSHOT.jar [INFO] deploying to lib: jetspeed-commons-2.2-SNAPSHOT.jar [INFO] deploying to lib: pluto-container-api-2.0.0-SNAPSHOT.jar [INFO] deploying to lib: pluto-taglib-2.0.0-SNAPSHOT.jar [INFO] deploying to lib: portals-bridges-common-1.0.4.jar [INFO] deploying to war: jetspeed (expanded) [INFO] deploying to context: context.xml [INFO] deploying to war: j2-admin (expanded) [INFO] deploying to war: demo.war (infused) Found web.xml Found WEB-INF/portlet.xml Attempting to add portlet.tld to war... Adding portlet.tld to war... Creating war /tmp/apa-demo-1.0-SNAPSHOT.war.infused-28902 ... War /tmp/apa-demo-1.0-SNAPSHOT.war.infused-28902 created [INFO] deploying to war: rss.war (infused) Found web.xml Found WEB-INF/portlet.xml Attempting to add portlet.tld to war... Adding portlet.tld to war... Creating war /tmp/apa-rss-war-1.0-SNAPSHOT.war.infused-28904 ... War /tmp/apa-rss-war-1.0-SNAPSHOT.war.infused-28904 created [INFO] deploying to war: webcontent.war (infused) Found web.xml Found WEB-INF/portlet.xml Attempting to add portlet.tld to war... Adding portlet.tld to war... Creating war /tmp/apa-webcontent-war-1.0-SNAPSHOT.war.infused-28906 ... War /tmp/apa-webcontent-war-1.0-SNAPSHOT.war.infused-28906 created Here is a listing of the target deployment directory: > ls -l /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18/webapps/ total 16680 rw-rw-r - 1 rwatler rwatler 7956188 2009-05-11 12:18 demo.war drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:18 host-manager/ drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:18 j2-admin/ drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:18 jetspeed/ drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:18 manager/ drwxrwxr-x 3 rwatler rwatler 4096 2009-05-11 12:18 ROOT/ rw-rw-r - 1 rwatler rwatler 4860899 2009-05-11 12:18 rss.war rw-rw-r - 1 rwatler rwatler 4208046 2009-05-11 12:18 webcontent.war j2-admin and jetspeed are both expanded and demo, rss, and webcontent have been infused and deployed as wars.
        Hide
        Randy Watler added a comment -

        Finally have been able to recreate this issue: setting BOTH expand and infuse tags leads to improperly named expanded webapp directory:

        > ls -l /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18/webapps/
        total 32
        drwxrwxr-x 7 rwatler rwatler 4096 2009-05-11 12:37 demo.war/
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 host-manager/
        drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:37 j2-admin/
        drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:37 jetspeed/
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 manager/
        drwxrwxr-x 3 rwatler rwatler 4096 2009-05-11 12:37 ROOT/
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 rss.war/
        drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 webcontent.war/

        Note *.war named directories.

        Show
        Randy Watler added a comment - Finally have been able to recreate this issue: setting BOTH expand and infuse tags leads to improperly named expanded webapp directory: > ls -l /home/rwatler/j2/jetspeed-installer/target/apache-tomcat-6.0.18/webapps/ total 32 drwxrwxr-x 7 rwatler rwatler 4096 2009-05-11 12:37 demo.war/ drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 host-manager/ drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:37 j2-admin/ drwxrwxr-x 9 rwatler rwatler 4096 2009-05-11 12:37 jetspeed/ drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 manager/ drwxrwxr-x 3 rwatler rwatler 4096 2009-05-11 12:37 ROOT/ drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 rss.war/ drwxrwxr-x 5 rwatler rwatler 4096 2009-05-11 12:37 webcontent.war/ Note *.war named directories.
        Hide
        Randy Watler added a comment -

        Adding <expand>true</expand> requires setting an explicit target name. For example:

        <deployment>
        <artifact>org.apache.portals.applications:apa-demo:war</artifact>
        <targetName>demo</targetName>
        <expand>true</expand>
        <infuse>true</infuse>
        <delete>./demo</delete>
        </deployment>

        Works as designed.

        Show
        Randy Watler added a comment - Adding <expand>true</expand> requires setting an explicit target name. For example: <deployment> <artifact>org.apache.portals.applications:apa-demo:war</artifact> <targetName>demo</targetName> <expand>true</expand> <infuse>true</infuse> <delete>./demo</delete> </deployment> Works as designed.

          People

          • Assignee:
            Randy Watler
            Reporter:
            Jeroen Hoffman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development