You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2010/04/01 11:48:02 UTC
svn commit: r929896 - in /portals/jetspeed-2/portal/trunk: ./ maven/
maven/jetspeed-archetype/
maven/jetspeed-archetype/src/main/resources/META-INF/maven/
maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/
maven/...
Author: rwatler
Date: Thu Apr 1 09:48:02 2010
New Revision: 929896
URL: http://svn.apache.org/viewvc?rev=929896&view=rev
Log:
JS2-1158: Update J2 Maven Archetype
------------------------------------------------------------------------------
- update maven archetype resources and build poms to support min-ui configuration
by dynamically pulling artifacts from jetspeed-portal-resources and jetspeed
instead of maintaining multiple copies that fall out of date
- create new jetspeed-unpack-war-maven-plugin as a clone of jetspeed-unpack-maven-plugin
to deal with maven 2.2.1's refusal to allow a plugin to have different dependencies
in different poms, (using different plugins with universal configurations is a brute
force work-around)
- extend unpack plugin to support renaming when one file is being extracted from an
artifact
Added:
portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/
portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/AbstractUnpackMojo.java
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/pom.xml
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackWarMojo.java
Removed:
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype.xml
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/sql/
Modified:
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/pom.xml
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/pom.xml
portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages/default-page.psml
portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/utils/UnpackResources.java
portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackMojo.java
portals/jetspeed-2/portal/trunk/maven/pom.xml
portals/jetspeed-2/portal/trunk/pom.xml
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/pom.xml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/pom.xml Thu Apr 1 09:48:02 2010
@@ -23,14 +23,15 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jetspeed-archetype</artifactId>
- <description>Jetspeed 2 Deploy Maven Plugin</description>
- <name>jetspeed-archetype</name>
+ <description>Jetspeed 2 Maven Archetype</description>
+ <name>Jetspeed 2 Maven Archetype</name>
<packaging>maven-archetype</packaging>
<parent>
<groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>maven</artifactId>
<version>2.2.1-SNAPSHOT</version>
</parent>
+
<build>
<extensions>
<extension>
@@ -45,6 +46,84 @@
<version>2.0-alpha-4</version>
<extensions>true</extensions>
</plugin>
+
+ <plugin>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed-unpack-maven-plugin</artifactId>
+ <version>${pom.version}</version>
+ <executions>
+ <execution>
+ <id>unpack-archetype-seed-resources</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <unpack>
+ <artifact>${pom.groupId}:jetspeed-portal-resources:jar</artifact>
+ <targetDirectory>${project.build.outputDirectory}</targetDirectory>
+ <resources>
+ <resource>
+ <path>seed/min</path>
+ <include>j2-ui-seed.xml</include>
+ <destination>archetype-resources/__rootArtifactId__-portal/src/sql/min</destination>
+ <name>j2-seed.xml</name>
+ </resource>
+ <resource>
+ <path>conf/jetspeed</path>
+ <include>override.properties</include>
+ <destination>archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/conf</destination>
+ </resource>
+ </resources>
+ </unpack>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed-portal-resources</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed-unpack-war-maven-plugin</artifactId>
+ <version>${pom.version}</version>
+ <executions>
+ <execution>
+ <id>unpack-archetype-page-resources</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <unpack>
+ <artifact>${pom.groupId}:jetspeed:war</artifact>
+ <targetDirectory>${project.build.outputDirectory}</targetDirectory>
+ <resources>
+ <resource>
+ <path>WEB-INF/min-ui-pages</path>
+ <include>**/*</include>
+ <destination>archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages</destination>
+ <overwrite>false</overwrite>
+ </resource>
+ </resources>
+ </unpack>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed</artifactId>
+ <version>${pom.version}</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml Thu Apr 1 09:48:02 2010
@@ -30,9 +30,20 @@
<module id="${rootArtifactId}-portal" dir="__rootArtifactId__-portal" name="${rootArtifactId}-portal">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/webapp</directory>
+ <directory>src/main/webapp/WEB-INF/pages</directory>
<includes>
+ <include>**/folder.metadata</include>
<include>**/*.psml</include>
+ <include>**/*.tpsml</include>
+ <include>**/*.fpsml</include>
+ <include>**/*.dpsml</include>
+ <include>**/*.link</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp/WEB-INF/conf</directory>
+ <includes>
+ <include>**/*.properties</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
@@ -79,4 +90,4 @@
</fileSets>
</module>
</modules>
-</archetype-descriptor>
\ No newline at end of file
+</archetype-descriptor>
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/pom.xml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/pom.xml Thu Apr 1 09:48:02 2010
@@ -74,6 +74,41 @@
<plugins>
<plugin>
<groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-unpack-maven-plugin</artifactId>
+ <version>${dollar}{org.apache.portals.jetspeed.version}</version>
+ <executions>
+ <execution>
+ <id>unpack-jetspeed-properties</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <unpack>
+ <artifact>org.apache.portals.jetspeed-2:jetspeed-portal-resources:jar</artifact>
+ <targetDirectory>${dollar}{project.build.directory}/${dollar}{project.build.finalName}</targetDirectory>
+ <resources>
+ <resource>
+ <path>conf/jetspeed</path>
+ <include>jetspeed.properties</include>
+ <destination>WEB-INF/conf</destination>
+ </resource>
+ </resources>
+ </unpack>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-portal-resources</artifactId>
+ <version>${dollar}{org.apache.portals.jetspeed.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed-deploy-maven-plugin</artifactId>
<version>${dollar}{org.apache.portals.jetspeed.version}</version>
<executions>
@@ -107,36 +142,45 @@
</dependencies>
</plugin>
<plugin>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-fileutils-maven-plugin</artifactId>
+ <version>${dollar}{org.apache.portals.jetspeed.version}</version>
+ <executions>
+ <execution>
+ <id>configure-jetspeed-properties</id>
+ <goals>
+ <goal>event</goal>
+ </goals>
+ <phase>process-resources</phase>
+ <configuration>
+ <srcFilePath>${dollar}{project.build.directory}/${dollar}{project.build.finalName}/WEB-INF/conf/jetspeed.properties</srcFilePath>
+ <editPattern>^jetui.customization.method%5Cs*=.*%24</editPattern><!-- use %24 for '$' and %5C for '\' -->
+ <replacePattern>jetui.customization.method%20=%20ajax</replacePattern><!-- use %20 for space -->
+ <event>edit</event>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>${dollar}{pom.artifactId}</warName>
- <!--<overlays>
- <overlay>
- <id>jetspeed1</id>
- <groupId>org.apache.portals.jetspeed-2</groupId>
- <artifactId>jetspeed</artifactId>
- <includes>
- <include>decorations/layout/css/**</include>
- <include>decorations/portlet/clear/**</include>
- <include>decorations/portlet/decorator.vm</include>
- </includes>
- </overlay>
+ <overlays>
<overlay>
- <id>jetspeed2</id>
+ <id>jetspeed</id>
<groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed</artifactId>
<excludes>
- <exclude>*.jsp</exclude>
- <exclude>ajax/**</exclude>
- <exclude>decorations/**</exclude>
- <exclude>images/**</exclude>
- <exclude>javascript/**</exclude>
<exclude>WEB-INF/pages/**</exclude>
<exclude>WEB-INF/min-pages/**</exclude>
+ <exclude>WEB-INF/ui-pages/**</exclude>
+ <exclude>WEB-INF/min-ui-pages/**</exclude>
+ <exclude>WEB-INF/conf/jetspeed.properties</exclude>
</excludes>
</overlay>
- </overlays>-->
+ </overlays>
</configuration>
</plugin>
</plugins>
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages/default-page.psml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages/default-page.psml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages/default-page.psml (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-archetype/src/main/resources/archetype-resources/__rootArtifactId__-portal/src/main/webapp/WEB-INF/pages/default-page.psml Thu Apr 1 09:48:02 2010
@@ -1,63 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
-->
<page id="default-page"
xmlns="http://portals.apache.org/jetspeed"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.2/schemas/psml.xsd">
- <defaults
- layout-decorator="jetspeed"
- portlet-decorator="jetspeed"
- />
- <title>Welcome to Jetspeed 2</title>
- <metadata name="title" xml:lang="fr">Bienvenue a Jetspeed</metadata>
- <metadata name="title" xml:lang="ja">Jetspeed 2 ã¸ãããã</metadata>
- <metadata name="title" xml:lang="es">¡Bienvenido a Jetspeed 2!</metadata>
- <metadata name="title" xml:lang="hu">Köszönti a Jetspeed 2!</metadata>
- <metadata name="title" xml:lang="zh">欢è¿æ¥å°Jetspeed 2</metadata>
- <metadata name="title" xml:lang="zh-TW">æ¡è¿ä¾å°Jetspeed 2</metadata>
- <metadata name="title" xml:lang="ko">Jetspeed 2 ì ì¤ì ê²ì íìí©ëë¤</metadata>
-
- <fragment id="dp-1" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
- <fragment id="dp-12" type="portlet" name="j2-admin::LoginPortlet">
- <property layout="TwoColumns" name="row" value="0" />
- <property layout="TwoColumns" name="column" value="0" />
- </fragment>
- <fragment id="dp-22" type="portlet" name="j2-admin::ForgottenPasswordPortlet">
- <property layout="TwoColumns" name="row" value="1" />
- <property layout="TwoColumns" name="column" value="0" />
- </fragment>
- <fragment id="dp-7" type="portlet" name="${parentArtifactId}-pa::myportlet" >
- <property layout="TwoColumns" name="row" value="2" />
- <property layout="TwoColumns" name="column" value="0" />
- </fragment>
-
- <fragment id="dp-3" type="portlet" name="j2-admin::LocaleSelector">
- <property layout="TwoColumns" name="row" value="0" />
- <property layout="TwoColumns" name="column" value="1" />
- </fragment>
- <fragment id="dp-23" type="portlet" name="j2-admin::UserRegistrationPortlet">
- <property layout="TwoColumns" name="row" value="1" />
- <property layout="TwoColumns" name="column" value="1" />
- </fragment>
-
- </fragment>
-
+
+ <title>Users Home</title>
+
+ <fragment id="jsmin-2" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
+ <fragment id="jsmin-3" type="portlet" name="j2-admin::LoginPortlet">
+ <property name="row" value="0" />
+ <property name="column" value="0" />
+ </fragment>
+ <fragment id="jsmin-6-myportlet" type="portlet" name="${parentArtifactId}-pa::myportlet" >
+ <property name="row" value="1" />
+ <property name="column" value="0" />
+ </fragment>
+ <fragment id="jsmin-4" type="portlet" name="j2-admin::LocaleSelector">
+ <property name="row" value="0" />
+ <property name="column" value="1" />
+ </fragment>
+ </fragment>
<security-constraints>
- <security-constraints-ref>public-view</security-constraints-ref>
+ <security-constraints-ref>AEUV</security-constraints-ref>
</security-constraints>
</page>
Added: portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/AbstractUnpackMojo.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/AbstractUnpackMojo.java?rev=929896&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/AbstractUnpackMojo.java (added)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/mojo/AbstractUnpackMojo.java Thu Apr 1 09:48:02 2010
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.maven.mojo;
+
+import java.util.Set;
+
+import org.apache.jetspeed.maven.utils.Artifacts;
+import org.apache.jetspeed.maven.utils.UnpackResources;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * AbstractUnpackMojo provides extracting specific folders within a
+ * (remote) resource jar to specific output folders.
+ *
+ * @version $Id$
+ * @goal unpack
+ */
+public abstract class AbstractUnpackMojo extends AbstractMojo
+{
+ private Artifacts artifacts;
+
+ /* (non-Javadoc)
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ if ( isSkip() )
+ {
+ this.getLog().info( "Skipping unpack" );
+ return;
+ }
+
+ artifacts = new Artifacts(getPluginDependencyArtifacts());
+
+ if (getUnpack() != null)
+ {
+ getUnpack().unpack(artifacts, getProject().getBuild().getDirectory(), getLog(), isVerbose());
+ }
+ }
+
+ protected abstract boolean isSkip();
+
+ protected abstract Set getPluginDependencyArtifacts();
+
+ protected abstract UnpackResources getUnpack();
+
+ protected abstract MavenProject getProject();
+
+ protected abstract boolean isVerbose();
+}
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/utils/UnpackResources.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/utils/UnpackResources.java?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/utils/UnpackResources.java (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-maven-utils/src/main/java/org/apache/jetspeed/maven/utils/UnpackResources.java Thu Apr 1 09:48:02 2010
@@ -44,6 +44,7 @@ public class UnpackResources
private Boolean flat;
private String include;
private String exclude;
+ private String name;
}
private static class UnpackResource
@@ -169,6 +170,8 @@ public class UnpackResources
private boolean flat;
private boolean overwrite;
+
+ private String name;
public EntrySet entrySet;
@@ -185,6 +188,7 @@ public class UnpackResources
dest = makeRelativePath(resource.destination);
overwrite = getValue(resource.overwrite, defaultOverwrite).booleanValue();
flat = getValue(resource.flat, Boolean.FALSE).booleanValue();
+ name = resource.name;
if (resource.path != null || resource.include != null || resource.exclude != null )
{
@@ -301,11 +305,11 @@ public class UnpackResources
}
if (dest.length() > 0 )
{
- destFileName = baseDirectory + File.separator + dest + File.separator + entryName;
+ destFileName = baseDirectory + File.separator + dest + File.separator + ((name == null) ? entryName : name);
}
else
{
- destFileName = baseDirectory + entryName;
+ destFileName = baseDirectory + ((name == null) ? entryName : name);
}
}
}
Modified: portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackMojo.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackMojo.java?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackMojo.java (original)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackMojo.java Thu Apr 1 09:48:02 2010
@@ -18,20 +18,17 @@ package org.apache.jetspeed.maven.plugin
import java.util.Set;
-import org.apache.jetspeed.maven.utils.Artifacts;
+import org.apache.jetspeed.maven.mojo.AbstractUnpackMojo;
import org.apache.jetspeed.maven.utils.UnpackResources;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
/**
- * UnpackMojo provides extracting specific folders within a (remote) resource jar to specific output folders.
+ * UnpackMojo provides extraction services.
*
* @version $Id$
* @goal unpack
*/
-public class UnpackMojo extends AbstractMojo
+public class UnpackMojo extends AbstractUnpackMojo
{
/**
* When true, skip the execution.
@@ -54,7 +51,6 @@ public class UnpackMojo extends Abstract
* @readonly
**/
private Set pluginDependencyArtifacts;
- private Artifacts artifacts;
/** The Maven project.
* @parameter expression="${project}"
@@ -62,23 +58,29 @@ public class UnpackMojo extends Abstract
* @readonly
*/
private MavenProject project;
-
- /* (non-Javadoc)
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException
+
+ protected boolean isSkip()
+ {
+ return skip;
+ }
+
+ protected Set getPluginDependencyArtifacts()
+ {
+ return pluginDependencyArtifacts;
+ }
+
+ protected UnpackResources getUnpack()
{
- if ( skip )
- {
- this.getLog().info( "Skipping unpack" );
- return;
- }
+ return unpack;
+ }
+
+ protected MavenProject getProject()
+ {
+ return project;
+ }
- artifacts = new Artifacts(pluginDependencyArtifacts);
-
- if (unpack != null)
- {
- unpack.unpack(artifacts, project.getBuild().getDirectory(), getLog(), false);
- }
+ protected boolean isVerbose()
+ {
+ return verbose;
}
}
Added: portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/pom.xml?rev=929896&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/pom.xml (added)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/pom.xml Thu Apr 1 09:48:02 2010
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: pom.xml 777775 2009-05-23 02:41:18Z taylor $
+-->
+<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>
+ <prerequisites>
+ <maven>2.0.9</maven>
+ </prerequisites>
+
+ <artifactId>jetspeed-unpack-war-maven-plugin</artifactId>
+ <name>Jetspeed 2 Unpack WAR Maven Plugin</name>
+ <description>Jetspeed 2 Unpack WAR Maven Plugin</description>
+ <parent>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>maven</artifactId>
+ <version>2.2.1-SNAPSHOT</version>
+ </parent>
+ <packaging>maven-plugin</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed-maven-utils</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.7</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <goalPrefix>jetspeed-unpack-war</goalPrefix>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackWarMojo.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackWarMojo.java?rev=929896&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackWarMojo.java (added)
+++ portals/jetspeed-2/portal/trunk/maven/jetspeed-unpack-war-maven-plugin/src/main/java/org/apache/jetspeed/maven/plugins/UnpackWarMojo.java Thu Apr 1 09:48:02 2010
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.maven.plugins;
+
+import java.util.Set;
+
+import org.apache.jetspeed.maven.utils.UnpackResources;
+import org.apache.jetspeed.maven.mojo.AbstractUnpackMojo;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * UnpackWarMojo provides extraction services.
+ *
+ * @version $Id$
+ * @goal unpack
+ */
+public class UnpackWarMojo extends AbstractUnpackMojo
+{
+ /**
+ * When true, skip the execution.
+ * @parameter default-value="false"
+ */
+ private boolean skip;
+
+ /**
+ * When true, INFO log copied/skipped resources
+ * @parameter default-value="false"
+ */
+ private boolean verbose;
+
+ /**
+ * @parameter
+ */
+ private UnpackResources unpack;
+
+ /** @parameter expression="${plugin.introducedDependencyArtifacts}"
+ * @readonly
+ **/
+ private Set pluginDependencyArtifacts;
+
+ /** The Maven project.
+ * @parameter expression="${project}"
+ * @required
+ * @readonly
+ */
+ private MavenProject project;
+
+ protected boolean isSkip()
+ {
+ return skip;
+ }
+
+ protected Set getPluginDependencyArtifacts()
+ {
+ return pluginDependencyArtifacts;
+ }
+
+ protected UnpackResources getUnpack()
+ {
+ return unpack;
+ }
+
+ protected MavenProject getProject()
+ {
+ return project;
+ }
+
+ protected boolean isVerbose()
+ {
+ return verbose;
+ }
+}
Modified: portals/jetspeed-2/portal/trunk/maven/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/maven/pom.xml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/maven/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/maven/pom.xml Thu Apr 1 09:48:02 2010
@@ -39,6 +39,7 @@
<module>jetspeed-maven-utils</module>
<module>jetspeed-mvn-maven-plugin</module>
<module>jetspeed-unpack-maven-plugin</module>
+ <module>jetspeed-unpack-war-maven-plugin</module>
<module>jetspeed-deploy-maven-plugin</module>
<module>jetspeed-db-maven-plugin</module>
<module>jetspeed-archetype</module>
Modified: portals/jetspeed-2/portal/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/pom.xml?rev=929896&r1=929895&r2=929896&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/pom.xml (original)
+++ portals/jetspeed-2/portal/trunk/pom.xml Thu Apr 1 09:48:02 2010
@@ -341,6 +341,12 @@
</dependency>
<dependency>
<groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-unpack-war-maven-plugin</artifactId>
+ <version>${pom.version}</version>
+ <type>maven-plugin</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
<artifactId>jetspeed-db-maven-plugin</artifactId>
<version>${pom.version}</version>
<type>maven-plugin</type>
@@ -1567,6 +1573,19 @@
</dependency>
</dependencies>
</plugin>
+ <plugin>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-unpack-war-maven-plugin</artifactId>
+ <version>${pom.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>jetspeed</artifactId>
+ <version>${pom.version}</version>
+ <type>war</type>
+ </dependency>
+ </dependencies>
+ </plugin>
<plugin>
<groupId>org.apache.portals.jetspeed-2</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org