templates.maven.pom.xml Maven / Gradle / Ivy
<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> <groupId>mygroup</groupId> <artifactId>myartifact</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <properties> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.testTarget>1.7</maven.compiler.testTarget> <maven.compiler.testSource>1.7</maven.compiler.testSource> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--Vertx module name--> <module.name>${project.groupId}~${project.artifactId}~${project.version}</module.name> <!-- Set pullInDeps to true if you want any modules specified in the 'includes' and 'deploys' fields in your mod.json to be automatically pulled in during packaging and added inside your module. Doing this means your module won't download and install those dependencies at run-time when they're first requested. --> <vertx.pullInDeps>false</vertx.pullInDeps> <!-- Set createFatJar to true if you want to create a fat executable jar which contains the Vert.x binaries along with the module so it can be run with java -jar <jarname> --> <vertx.createFatJar>false</vertx.createFatJar> <!-- The directory where the module will be assembled - you can override this on the command line with -Dmods.directory=mydir --> <mods.directory>target/mods</mods.directory> <!-- Dependency versions --> <vertx.version>2.1.5</vertx.version> <groovy.version>2.3.3</groovy.version> </properties> <dependencies> <dependency> <groupId>org.jetbrains</groupId> <artifactId>annotations</artifactId> <version>13.0</version> <optional>true</optional> </dependency> <!-- YOKE --> <!-- GROOVY Support --> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>${groovy.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>lang-groovy</artifactId> <version>2.1.1-final</version> <scope>provided</scope> </dependency> <!-- JavaScript Support --> <dependency> <groupId>org.mozilla</groupId> <artifactId>rhino</artifactId> <version>1.7R4</version> <scope>provided</scope> </dependency> <!-- Core --> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-core</artifactId> <version>${vertx.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-platform</artifactId> <version>${vertx.version}</version> <scope>provided</scope> </dependency> <!-- Testing --> <dependency> <groupId>io.vertx</groupId> <artifactId>testtools</artifactId> <version>2.0.3-final</version> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.gmaven</groupId> <artifactId>gmaven-plugin</artifactId> <version>1.5</version> <configuration> <source>2.0</source> <providerSelection>2.0</providerSelection> <sourceEncoding>UTF-8</sourceEncoding> </configuration> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>${groovy.version}</version> </dependency> </dependencies> <executions> <execution> <goals> <goal>generateStubs</goal> <goal>compile</goal> <goal>generateTestStubs</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> <!-- The vert.x Maven plugin --> <plugin> <groupId>io.vertx</groupId> <artifactId>vertx-maven-plugin</artifactId> <version>2.0.11-final</version> <configuration> <configFile>${project.basedir}/conf.json</configFile> </configuration> <!-- Make sure that the plugin uses the vert.x versions from this pom.xml not from its own pom.xml --> <dependencies> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-platform</artifactId> <version>${vertx.version}</version> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-core</artifactId> <version>${vertx.version}</version> </dependency> <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-hazelcast</artifactId> <version>${vertx.version}</version> </dependency> </dependencies> <executions> <execution> <id>PullInDeps</id> <phase>prepare-package</phase> <goals> <goal>pullInDeps</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.5</version> <executions> <execution> <id>copy-mod-to-target</id> <phase>prepare-package</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <overwrite>true</overwrite> <outputDirectory>${mods.directory}/${module.name}</outputDirectory> <resources> <resource> <directory>target/classes</directory> </resource> </resources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>copy-mod-dependencies-to-target</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${mods.directory}/${module.name}/lib</outputDirectory> <includeScope>runtime</includeScope> </configuration> </execution> <execution> <id>copy-mod-dependencies-to-target-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>target/dependencies</outputDirectory> <includeScope>runtime</includeScope> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.3</version> <configuration> <descriptors> <descriptor>src/main/assembly/mod.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>assemble</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>