Addressing the issue of controlling the name of the top-level directory by allowing artifactId to be something like "nifi-XXX-bundle" and artifactBaseName to be "XXX". Also refactored the archetype to allow the package to be specified, which updates the appropriate files and directories.

This commit is contained in:
bbende 2015-01-22 21:09:30 -05:00
parent db2072ed8a
commit 27f6918445
9 changed files with 58 additions and 49 deletions

View File

@ -22,5 +22,28 @@
<artifactId>nifi-maven-archetypes</artifactId>
<version>0.0.1-incubating-SNAPSHOT</version>
</parent>
<artifactId>nifi-processor-bundle-archetype</artifactId>
<packaging>maven-archetype</packaging>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>2.2</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@ -13,42 +13,28 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<archetype-descriptor name="nifi-${artifactId}-bundle">
<archetype-descriptor name="${artifactId}">
<requiredProperties>
<requiredProperty key="artifactBaseName" />
<requiredProperty key="nifiVersion" >
<defaultValue>0.0.1-incubating-SNAPSHOT</defaultValue>
</requiredProperty>
</requiredProperties>
<modules>
<module id="nifi-${rootArtifactId}-processors" dir="nifi-__rootArtifactId__-processors" name="nifi-${rootArtifactId}-processors">
<fileSets>
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
<directory>nifi-__artifactBaseName__-processors</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*.Processor</include>
<include>**/index.html</include>
</includes>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>nifi-__artifactBaseName__-processors/src/main/java</directory>
</fileSet>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>nifi-__artifactBaseName__-processors/src/test/java</directory>
</fileSet>
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
<directory>nifi-__artifactBaseName__-nar</directory>
</fileSet>
</fileSets>
</module>
<module id="nifi-${rootArtifactId}-nar" dir="nifi-__rootArtifactId__-nar" name="nifi-${rootArtifactId}-nar">
<fileSets>
<fileSet encoding="UTF-8">
<directory></directory>
</fileSet>
</fileSets>
</module>
</modules>
</archetype-descriptor>

View File

@ -18,20 +18,20 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>nifi-${rootArtifactId}-bundle</artifactId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<artifactId>${artifactId}</artifactId>
<artifactId>nifi-${artifactBaseName}-nar</artifactId>
<version>${version}</version>
<packaging>nar</packaging>
<name>${artifactId}</name>
<name>nifi-${artifactBaseName}-nar</name>
<dependencies>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>nifi-${rootArtifactId}-processors</artifactId>
<artifactId>nifi-${artifactBaseName}-processors</artifactId>
<version>${version}</version>
</dependency>
</dependencies>

View File

@ -18,14 +18,14 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>nifi-${rootArtifactId}-bundle</artifactId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
<artifactId>${artifactId}</artifactId>
<artifactId>nifi-${artifactBaseName}-processors</artifactId>
<packaging>jar</packaging>
<name>${artifactId}</name>
<name>nifi-${artifactBaseName}-processors</name>
<url>http://maven.apache.org</url>
<properties>

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.processors;
package ${package};
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.PropertyValue;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.processors;
package ${package};
import org.apache.nifi.util.TestRunner;
import org.apache.nifi.util.TestRunners;

View File

@ -23,11 +23,11 @@
</parent>
<groupId>${groupId}</groupId>
<artifactId>nifi-${artifactId}-bundle</artifactId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>pom</packaging>
<name>nifi-${artifactId}-bundle</name>
<name>${artifactId}</name>
<url>http://maven.apache.org</url>
<properties>
@ -35,8 +35,8 @@
</properties>
<modules>
<module>nifi-${rootArtifactId}-processors</module>
<module>nifi-${rootArtifactId}-nar</module>
<module>nifi-${artifactBaseName}-processors</module>
<module>nifi-${artifactBaseName}-nar</module>
</modules>
</project>