Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
STP/Stardust/KnowledgeBase/BuildChangeMgmt/Using Maven Overlays to Create Custom Stardust Portal
< STP | Stardust | KnowledgeBase
Revision as of 06:34, 15 December 2011 by Ganesh.lawande.sungard.com (Talk | contribs) (→Build the Final Project)
Using Maven Overlays to Create Custom Stardust Portal
Contents
Introduction
Parent Project
the pom looks like
<?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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>sungard</groupId> <artifactId>test-portal-project</artifactId> <version>6.0.3</version> <name>test-portal-project</name> <description>holds the ipp portal facets file</description> <packaging>pom</packaging> <properties> <ipp.version>6.0.3</ipp.version> </properties> <modules> <module>project-portal-war</module> </modules> <repositories> <repository> <id>central-mirror-internal</id> <url>https://infinity.sungard.com/repository/repo </url> </repository> <repository> <id>csa-public-repo</id> <url> https://svn.csa.sungard.com/maven_jar_repository/repository/public </url> </repository> <repository> <id>Public-Maven-repository</id> <url>http://repo1.maven.org/maven2</url> </repository> <repository> <id>Apache-Camel-Releases</id> <url> https://repository.apache.org/content/repositories/releases </url> </repository> </repositories> </project>
Custom Project War
<?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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>sungard</groupId> <artifactId>test-portal-project</artifactId> <version>6.0.3</version> </parent> <groupId>sungard</groupId> <artifactId>project-portal-war</artifactId> <packaging>war</packaging> <version>6.0.3</version> <name>project-portal-war</name> <description>holds the project facets</description> <properties> <ipp.version>6.0.3</ipp.version> </properties> <build> <resources> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory>src/main/java</directory> <filtering>true</filtering> <includes> <include>**/*.properties</include> <include>com/mypakge/cs/**/*-context.xml</include> </includes> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.6<//source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> <!-- This creates the WAR file for the project --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1-alpha-1</version> <configuration> <archiveClasses>true</archiveClasses> <overlays> <overlay> <groupId>org.eclipse.stardust.test</groupId> <artifactId>stardust-portal-war</artifactId> <type>war</type> </overlay> </overlays> <webResources> <resource> <directory> ${basedir}/src/main/webapp </directory> <includes> <include>*</include> </includes> <targetPath>/</targetPath> </resource> </webResources> <dependentWarExcludes>WEB-INF/web.xml,WEB-INF/lib/jaxws-api-2.0.jar,WEB-INF/lib/jaxb-api-2.0.jar </dependentWarExcludes> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.eclipse.stardust.test</groupId> <artifactId>stardust-portal-war</artifactId> <version>1.0-SNAPSHOT</version> <type>war</type> </dependency> </dependencies> <repositories> <repository> <id>central-mirror-internal</id> <url>https://infinity.sungard.com/repository/repo </url> </repository> <repository> <id>csa-public-repo</id> <url> https://svn.csa.sungard.com/maven_jar_repository/repository/public </url> </repository> <repository> <id>Public-Maven-repository</id> <url>http://repo1.maven.org/maven2</url> </repository> <repository> <id>Apache-Camel-Releases</id> <url> https://repository.apache.org/content/repositories/releases </url> </repository> </repositories> </project>
Running Archetype Command to Add Stardust Portal as Module
mvn archetype:generate -DarchetypeGroupId=com.infinity.bpm.archetypes -DarchetypeArtifactId=ipp-archetype-tc6-ipp-portal-war -DarchetypeVersion=6.0.3 -DgroupId=org.eclipse.stardust.test -DartifactId=stardust-portal-war -Dversion=1.0-SNAPSHOT -Dgoals=dependency:unpack
After you run this command it will download and add the stardust-portal-war as module to your parent project. You will one more entry in modules section.
<modules> <module>project-portal-war</module> <module>stardust-portal-war</module> </modules>
Note that you will have to change the order of these modules. We want the stardust-portal-war to be built befoer our custom project war builds. So change it as follows;
<modules> <module>stardust-portal-war</module> <module>project-portal-war</module> </modules>
Build the Final Project
Now use the mvn install command to build the final custom Stadust Portal project.
If the build was successful, you will see the Stardust Portal with custom project artefacts at /test-portal-project\project-portal-war\target.
test