skeleton-server-archetype-builder
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency> <groupId>io.airlift</groupId> <artifactId>skeleton-server-archetype-builder</artifactId> <version>0.95</version> </dependency>
<?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> <artifactId>skeleton-server-archetype-builder</artifactId> <packaging>pom</packaging> <parent> <groupId>io.airlift</groupId> <artifactId>airlift</artifactId> <version>0.95</version> </parent> <properties> <air.main.basedir>${project.parent.basedir}</air.main.basedir> <server-name>skeleton-server</server-name> </properties> <build> <plugins> <!-- This all super lame but works around a ton of bugs/limitations in the archetype plugin --> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>make-clean-copy-of-project</id> <phase>generate-sources</phase> <configuration> <target> <mkdir dir="${project.build.directory}/project" /> <copy todir="${project.build.directory}/project"> <fileset dir="${project.basedir}/../${server-name}"> <include name="src/**" /> <include name="etc/**" /> <include name="pom.xml" /> <include name=".gitignore" /> <include name="README.txt" /> <include name=".build-airlift" /> </fileset> </copy> <delete dir="${project.build.directory}/project-copy" /> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-invoker-plugin</artifactId> <executions> <execution> <id>generate-archetype</id> <phase>generate-sources</phase> <goals> <goal>run</goal> </goals> <configuration> <pomIncludes> <pomInclude>pom.xml</pomInclude> </pomIncludes> <projectsDirectory>${project.build.directory}/project</projectsDirectory> <!-- LAME: we have to copy again to avoid the interpolated-pom.xml file appearing in the archetype --> <cloneProjectsTo>${project.build.directory}/project-copy</cloneProjectsTo> <!-- LAME: we have to disable logging to void log file from appearing in the archetype --> <noLog>true</noLog> <streamLogs>true</streamLogs> <goals> <goal>org.apache.maven.plugins:maven-archetype-plugin:2.0:create-from-project</goal> </goals> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>munge-generated-pom</id> <phase>process-sources</phase> <configuration> <target> <move toDir="${project.build.directory}/archetype"> <fileset dir="${project.build.directory}/project-copy/target/generated-sources/archetype" /> </move> <!-- Remove distribution management section --> <replaceregexp file="${project.build.directory}/archetype/src/main/resources/archetype-resources/pom.xml" match="<distributionManagement>.*</distributionManagement>" replace="" flags="ms" /> <replace file="${project.build.directory}/archetype/src/main/resources/archetype-resources/pom.xml"> <replacefilter> <replacetoken><![CDATA[<air.main.basedir>${project.parent.basedir}</air.main.basedir>]]></replacetoken> <replacevalue /> </replacefilter> <replacefilter> <replacetoken><![CDATA[<main-class>io.airlift.skeleton.Main</main-class>]]></replacetoken> <replacevalue><![CDATA[<main-class>${package}.Main</main-class>]]></replacevalue> </replacefilter> <!-- King of the lame: can't have a literal ${artifactId} in a value anywhere in a pom or it gets interpolated so split the property across two replacements --> <replacefilter> <replacetoken><![CDATA[<name>]]></replacetoken> <replacevalue><![CDATA[<name>${]]></replacevalue> </replacefilter> <replacefilter> <replacetoken><![CDATA[${server-name}</name>]]></replacetoken> <replacevalue><![CDATA[artifactId}</name>]]></replacevalue> </replacefilter> </replace> <fixcrlf file="${project.build.directory}/archetype/pom.xml" eol="unix" /> <replace file="${project.build.directory}/archetype/pom.xml"> <replacefilter> <replacetoken><![CDATA[<build>]]></replacetoken> <replacevalue><![CDATA[ <parent> <groupId>io.airlift</groupId> <artifactId>airbase</artifactId> <version>5</version> </parent> <properties> <air.check.skip-all>true</air.check.skip-all> </properties> <description>Skeleton server archetype</description> <url>http://github.com/airlift/airlift</url> <inceptionYear>2010</inceptionYear> <organization> <name>Airlift</name> </organization> <licenses> <license> <name>Apache License 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> <distribution>repo</distribution> </license> </licenses> <developers /> <scm> <connection>scm:git:git://github.com/airlift/airlift.git</connection> <developerConnection>scm:git:git@github.com:airlift/airlift.git</developerConnection> <url>http://github.com/airlift/airlift/tree/master</url> </scm> <build>]]></replacevalue> </replacefilter> </replace> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-invoker-plugin</artifactId> <configuration> <pomIncludes> <pomInclude>pom.xml</pomInclude> </pomIncludes> <projectsDirectory>${project.build.directory}/archetype</projectsDirectory> <streamLogs>true</streamLogs> </configuration> <executions> <execution> <id>package-archetype</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <goals> <goal>package</goal> </goals> </configuration> </execution> <execution> <id>install-archetype</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <goals> <goal>install</goal> </goals> </configuration> </execution> <execution> <id>deploy-archetype</id> <phase>deploy</phase> <goals> <goal>run</goal> </goals> <configuration> <goals> <goal>deploy</goal> </goals> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>