Skip to content

Commit

Permalink
HBASE-14878 Add hbase-shaded-client archetype to hbase-archetypes
Browse files Browse the repository at this point in the history
Signed-off-by: Elliott Clark <eclark@apache.org>
  • Loading branch information
dvimont authored and elliottneilclark committed Feb 29, 2016
1 parent 88f7759 commit 83297f6
Show file tree
Hide file tree
Showing 10 changed files with 659 additions and 5 deletions.
10 changes: 7 additions & 3 deletions hbase-archetypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ of the new archetype. (It may be most straightforward to simply copy the `src`
and `pom.xml` components from one of the existing exemplar projects, replace
the `src/main` and `src/test` code, and modify the `pom.xml` file's
`<dependencies>`, `<artifactId>`,` <name>`, and `<description>` elements.)
2. Modify the `hbase-archetype-builder/pom.xml` file: (a) add the new exemplar
project to the `<modules>` element, and (b) add appropriate `<execution>`
2. Modify the `hbase-archetypes/pom.xml` file: add a new `<module>` subelement
to the `<modules>` element, with the new exemplar project's subdirectory name
as its value.
3. Modify the `hbase-archetype-builder/pom.xml` file: (a) add a new `<*.dir>`
subelement to the `<properties>` element, with the new exemplar project's
subdirectory name as its value, and (b) add appropriate `<execution>`
elements and `<transformationSet>` elements within the `<plugin>` elements
(using the existing entries from already-existing exemplar projects as a guide).
3. Add appropriate entries for the new exemplar project to the
4. Add appropriate entries for the new exemplar project to the
`createArchetypes.sh` and `installArchetypes.sh` scripts in the
`hbase-archetype-builder` subdirectory (using the existing entries as a guide).

Expand Down
4 changes: 4 additions & 0 deletions hbase-archetypes/hbase-archetype-builder/createArchetypes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ buildArchetypeSubdir=target/build-archetype
cd /"$workingDir"/../hbase-client-project/$buildArchetypeSubdir
mvn archetype:create-from-project

# CREATE hbase-shaded-client archetype
cd /"$workingDir"/../hbase-shaded-client-project/$buildArchetypeSubdir
mvn archetype:create-from-project

# add entries for additional archetypes above this comment (modeled on entries above)

cd "$workingDir"
4 changes: 4 additions & 0 deletions hbase-archetypes/hbase-archetype-builder/installArchetypes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ archetypeSourceSubdir=target/generated-sources/archetype
cd /"$workingDir"/../hbase-client-project/$buildArchetypeSubdir/$archetypeSourceSubdir
mvn install

# INSTALL hbase-shaded-client archetype
cd /"$workingDir"/../hbase-shaded-client-project/$buildArchetypeSubdir/$archetypeSourceSubdir
mvn install

# add entries for additional archetypes above this comment (modeled on entries above)

cd "$workingDir"
74 changes: 73 additions & 1 deletion hbase-archetypes/hbase-archetype-builder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<temp.exemplar.subdir>target/temp</temp.exemplar.subdir>
<temp.archetype.subdir>target/temp-arch</temp.archetype.subdir>
<hbase-client.dir>hbase-client-project</hbase-client.dir>
<hbase-shaded-client.dir>hbase-shaded-client-project</hbase-shaded-client.dir>
<!-- For new archetype, add corresponding *.dir property above this comment.
(See hbase-archetypes/README.txt for details on adding new archetype.) -->
</properties>
Expand All @@ -52,7 +53,7 @@
<version>2.7</version>
<executions>
<!-- maven-resources-plugin copies each exemplar project's src directory to
${build.archetype.subdir} subdirectory, and copy each project's pom.xml file
${build.archetype.subdir} subdirectory, and copies each project's pom.xml file
to ${temp.exemplar.subdir} subdirectory. (Filtering during copy replaces
${project-version} with literal value). The pom.xml files are processed
further using xml-maven-plugin for xslt transformation, below. -->
Expand Down Expand Up @@ -93,6 +94,43 @@
</resources>
</configuration>
</execution>
<execution>
<id>hbase-shaded-client__copy-src-to-build-archetype-subdir</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>/${project.basedir}/../${hbase-shaded-client.dir}/${build.archetype.subdir}</outputDirectory>
<resources>
<resource>
<directory>/${project.basedir}/../${hbase-shaded-client.dir}</directory>
<includes>
<include>src/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>hbase-shaded-client__copy-pom-to-temp-for-xslt-processing</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>/${project.basedir}/../${hbase-shaded-client.dir}/${temp.exemplar.subdir}</outputDirectory>
<resources>
<resource>
<directory>/${project.basedir}/../${hbase-shaded-client.dir}</directory>
<filtering>true</filtering> <!-- filtering replaces ${project.version} with literal -->
<includes>
<include>pom.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<!-- For new archetype, add pair of <execution> elements (modeled on existing elements) above this comment. -->

<!-- maven-resources-plugin copies each archetype project's pom.xml file
Expand All @@ -116,6 +154,24 @@
</resources>
</configuration>
</execution>
<execution>
<id>hbase-shaded-client-ARCHETYPE__copy-pom-to-temp-for-xslt-processing</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>/${project.basedir}/../${hbase-shaded-client.dir}/${temp.archetype.subdir}</outputDirectory>
<resources>
<resource>
<directory>/${project.basedir}/../${hbase-shaded-client.dir}/${build.archetype.subdir}/${archetype.source.subdir}</directory>
<includes>
<include>pom.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<!-- For new archetype, add <execution> element (modeled on existing elements) above this comment. -->
</executions>
</plugin>
Expand All @@ -142,6 +198,14 @@
<outputDir>/${project.basedir}/../${hbase-client.dir}/${build.archetype.subdir}</outputDir>
<stylesheet>modify_exemplar_pom.xsl</stylesheet>
</transformationSet>
<transformationSet>
<dir>/${project.basedir}/../${hbase-shaded-client.dir}/${temp.exemplar.subdir}</dir>
<includes>
<include>pom.xml</include>
</includes>
<outputDir>/${project.basedir}/../${hbase-shaded-client.dir}/${build.archetype.subdir}</outputDir>
<stylesheet>modify_exemplar_pom.xsl</stylesheet>
</transformationSet>
<!-- For new archetype, add <transformationSet> element (modeled on existing elements) above this comment. -->
</transformationSets>
</configuration>
Expand All @@ -164,6 +228,14 @@
<outputDir>/${project.basedir}/../${hbase-client.dir}/${build.archetype.subdir}/${archetype.source.subdir}</outputDir>
<stylesheet>modify_archetype_pom.xsl</stylesheet>
</transformationSet>
<transformationSet>
<dir>/${project.basedir}/../${hbase-shaded-client.dir}/${temp.archetype.subdir}</dir>
<includes>
<include>pom.xml</include>
</includes>
<outputDir>/${project.basedir}/../${hbase-shaded-client.dir}/${build.archetype.subdir}/${archetype.source.subdir}</outputDir>
<stylesheet>modify_archetype_pom.xsl</stylesheet>
</transformationSet>
<!-- For new archetype, add <transformationSet> element (modeled on existing elements) above this comment. -->
</transformationSets>
</configuration>
Expand Down
76 changes: 76 additions & 0 deletions hbase-archetypes/hbase-shaded-client-project/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?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">
<!--
/**
* 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.
*/
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>hbase-archetypes</artifactId>
<groupId>org.apache.hbase</groupId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hbase-shaded-client-project</artifactId>
<packaging>jar</packaging>
<name>Apache HBase - Exemplar for hbase-shaded-client archetype</name>
<description>Exemplar project for archetype with hbase-shaded-client dependency</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${compileSource}</maven.compiler.source>
<maven.compiler.target>${compileSource}</maven.compiler.target>
<surefire.version>2.19</surefire.version>
<junit.version>4.12</junit.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencies>
<!-- Dependency for hbase-testing-util must precede compile-scoped dependencies. -->
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-testing-util</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-shaded-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 83297f6

Please sign in to comment.