|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + JBoss, Home of Professional Open Source |
| 4 | + Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual |
| 5 | + contributors by the @authors tag. See the copyright.txt in the |
| 6 | + distribution for a full listing of individual contributors. |
| 7 | +
|
| 8 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | + you may not use this file except in compliance with the License. |
| 10 | + You may obtain a copy of the License at |
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +--> |
| 18 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 20 | + <modelVersion>4.0.0</modelVersion> |
| 21 | + |
| 22 | + <groupId>com.redhat.examples</groupId> |
| 23 | + <artifactId>backend</artifactId> |
| 24 | + <version>1.0</version> |
| 25 | + <packaging>war</packaging> |
| 26 | + |
| 27 | + |
| 28 | + <properties> |
| 29 | + <!-- Explicitly declaring the source encoding eliminates the following |
| 30 | + message: --> |
| 31 | + <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered |
| 32 | + resources, i.e. build is platform dependent! --> |
| 33 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 34 | + |
| 35 | + <!-- JBoss dependency versions --> |
| 36 | + <version.wildfly.maven.plugin>2.0.0.Final</version.wildfly.maven.plugin> |
| 37 | + |
| 38 | + <!-- Define the version of the JBoss BOMs we want to import to specify |
| 39 | + tested stacks. --> |
| 40 | + <version.jboss.bom>8.2.2.Final</version.jboss.bom> |
| 41 | + |
| 42 | + <!-- other plugin versions --> |
| 43 | + <version.compiler.plugin>3.1</version.compiler.plugin> |
| 44 | + <version.surefire.plugin>2.16</version.surefire.plugin> |
| 45 | + <version.war.plugin>2.5</version.war.plugin> |
| 46 | + |
| 47 | + <!-- maven-compiler-plugin --> |
| 48 | + <maven.compiler.target>1.8</maven.compiler.target> |
| 49 | + <maven.compiler.source>1.8</maven.compiler.source> |
| 50 | + |
| 51 | + <!-- Jackason Dependency --> |
| 52 | + <jackson-version>2.6.3</jackson-version> |
| 53 | + </properties> |
| 54 | + |
| 55 | + |
| 56 | + <dependencyManagement> |
| 57 | + <dependencies> |
| 58 | + <!-- JBoss distributes a complete set of Java EE 7 APIs including a Bill |
| 59 | + of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection) |
| 60 | + of artifacts. We use this here so that we always get the correct versions |
| 61 | + of artifacts. Here we use the jboss-javaee-7.0-with-tools stack (you can |
| 62 | + read this as the JBoss stack of the Java EE 7 APIs, with some extras tools |
| 63 | + for your project, such as Arquillian for testing) and the jboss-javaee-7.0-with-hibernate |
| 64 | + stack you can read this as the JBoss stack of the Java EE 7 APIs, with extras |
| 65 | + from the Hibernate family of projects) --> |
| 66 | + <dependency> |
| 67 | + <groupId>org.wildfly.bom</groupId> |
| 68 | + <artifactId>jboss-javaee-7.0-with-tools</artifactId> |
| 69 | + <version>${version.jboss.bom}</version> |
| 70 | + <type>pom</type> |
| 71 | + <scope>import</scope> |
| 72 | + </dependency> |
| 73 | + </dependencies> |
| 74 | + </dependencyManagement> |
| 75 | + |
| 76 | + <dependencies> |
| 77 | + |
| 78 | + <!-- First declare the APIs we depend on and need for compilation. All |
| 79 | + of them are provided by JBoss WildFly --> |
| 80 | + |
| 81 | + <!-- Import the CDI API, we use provided scope as the API is included in |
| 82 | + JBoss WildFly --> |
| 83 | + <dependency> |
| 84 | + <groupId>javax.enterprise</groupId> |
| 85 | + <artifactId>cdi-api</artifactId> |
| 86 | + <scope>provided</scope> |
| 87 | + </dependency> |
| 88 | + |
| 89 | + <!-- Import the CDI API, we use provided scope as the API is included in |
| 90 | + JBoss WildFly --> |
| 91 | + <dependency> |
| 92 | + <groupId>org.jboss.spec.javax.servlet</groupId> |
| 93 | + <artifactId>jboss-servlet-api_3.1_spec</artifactId> |
| 94 | + <scope>provided</scope> |
| 95 | + </dependency> |
| 96 | + |
| 97 | + <!-- Import the Common Annotations API (JSR-250), we use provided scope |
| 98 | + as the API is included in JBoss WildFly --> |
| 99 | + <dependency> |
| 100 | + <groupId>org.jboss.spec.javax.annotation</groupId> |
| 101 | + <artifactId>jboss-annotations-api_1.2_spec</artifactId> |
| 102 | + <scope>provided</scope> |
| 103 | + </dependency> |
| 104 | + |
| 105 | + |
| 106 | + <!-- Jackason dependency --> |
| 107 | + <dependency> |
| 108 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 109 | + <artifactId>jackson-databind</artifactId> |
| 110 | + <version>${jackson-version}</version> |
| 111 | + </dependency> |
| 112 | + |
| 113 | + </dependencies> |
| 114 | + |
| 115 | + <build> |
| 116 | + <!-- Maven will append the version to the finalName (which is the name |
| 117 | + given to the generated war, and hence the context root) --> |
| 118 | + <finalName>ROOT</finalName> |
| 119 | + <plugins> |
| 120 | + <plugin> |
| 121 | + <artifactId>maven-war-plugin</artifactId> |
| 122 | + <version>${version.war.plugin}</version> |
| 123 | + <configuration> |
| 124 | + <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! --> |
| 125 | + <failOnMissingWebXml>false</failOnMissingWebXml> |
| 126 | + </configuration> |
| 127 | + </plugin> |
| 128 | + <!-- The WildFly plugin deploys your war to a local WildFly container --> |
| 129 | + <!-- To use, run: mvn package wildfly:deploy --> |
| 130 | + <plugin> |
| 131 | + <groupId>org.wildfly.plugins</groupId> |
| 132 | + <artifactId>wildfly-maven-plugin</artifactId> |
| 133 | + <version>${version.wildfly.maven.plugin}</version> |
| 134 | + </plugin> |
| 135 | + </plugins> |
| 136 | + </build> |
| 137 | + |
| 138 | + <profiles> |
| 139 | + <profile> |
| 140 | + <!-- The default profile skips all tests, though you can tune it to run |
| 141 | + just unit tests based on a custom pattern --> |
| 142 | + <!-- Seperate profiles are provided for running all tests, including Arquillian |
| 143 | + tests that execute in the specified container --> |
| 144 | + <id>default</id> |
| 145 | + <activation> |
| 146 | + <activeByDefault>true</activeByDefault> |
| 147 | + </activation> |
| 148 | + <build> |
| 149 | + <plugins> |
| 150 | + <plugin> |
| 151 | + <artifactId>maven-surefire-plugin</artifactId> |
| 152 | + <version>${version.surefire.plugin}</version> |
| 153 | + <configuration> |
| 154 | + <skip>true</skip> |
| 155 | + </configuration> |
| 156 | + </plugin> |
| 157 | + </plugins> |
| 158 | + </build> |
| 159 | + </profile> |
| 160 | + |
| 161 | + </profiles> |
| 162 | +</project> |
0 commit comments