1.1.17.4.1 fejezet, Wildfly 10.x maven project
Beküldte pzoli - 2016, február 27 - 12:13du
Wildfly 10.x kitchensink project pom.xml
version.jboss.bom 10.0.0.Final
<?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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hu.infokristaly.homework</groupId> <artifactId>Homework4JSF</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>WildFly Quickstarts: Homework4JSF</name> <description>A starter Java EE 7 webapp project for use on JBoss WildFly</description> <url>http://wildfly.org</url> <licenses> <license> <name>Apache License, Version 2.0</name> <distribution>repo</distribution> <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> </license> </licenses> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <version.wildfly.maven.plugin>1.0.2.Final</version.wildfly.maven.plugin> <version.jboss.bom>10.0.0.Final</version.jboss.bom> <version.compiler.plugin>3.1</version.compiler.plugin> <version.surefire.plugin>2.17</version.surefire.plugin> <version.war.plugin>2.5</version.war.plugin> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> </properties> <repositories> <repository> <id>Java.Net</id> <url>http://download.java.net/maven/2/</url> </repository> </repositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-parent</artifactId> <version>${version.jboss.bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-ejb3</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-bean-validation</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-jsf</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-jpa</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-servlet-dist</artifactId> <version>${version.jboss.bom}</version> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.protocol</groupId> <artifactId>arquillian-protocol-servlet</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <!-- Maven will append the version to the finalName (which is the name given to the generated war, and hence the context root) --> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.war.plugin}</version> <configuration> <!-- Java EE 7 doesn't require web.xml, Maven needs to catch up! --> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <!-- The WildFly plugin deploys your war to a local WildFly container --> <!-- To use, run: mvn package wildfly:deploy --> <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>${version.wildfly.maven.plugin}</version> </plugin> </plugins> </build> <profiles> <profile> <!-- The default profile skips all tests, though you can tune it to run just unit tests based on a custom pattern --> <!-- Seperate profiles are provided for running all tests, including Arquillian tests that execute in the specified container --> <id>default</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.surefire.plugin}</version> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> </profile> <profile> <!-- An optional Arquillian testing profile that executes tests in your WildFly instance --> <!-- This profile will start a new WildFly instance, and execute the test, shutting it down when done --> <!-- Run with: mvn clean test -Parq-wildfly-managed --> <id>arq-wildfly-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <!-- An optional Arquillian testing profile that executes tests in a remote WildFly instance --> <!-- Run with: mvn clean test -Parq-wildfly-remote --> <id>arq-wildfly-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. --> <!-- Use this profile for any OpenShift specific customization your app will need. --> <!-- By default that is to put the resulting archive into the 'deployments' folder. --> <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --> <id>openshift</id> <build> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.war.plugin}</version> <configuration> <outputDirectory>deployments</outputDirectory> <warName>ROOT</warName> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>
A Wildfly JPA modult Hibernate-Core modulra is lecserélhetjük, így elérhető több annotáció, mint pl. @Type
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <scope>provided</scope> </dependency>
@Type(type = "org.hibernate.type.TextType") @Lob @Column(columnDefinition="text") public String getComment() { return comment; }
Ha poi-ooxml-t használunk, ki kell venni a dom4j-t a függőségekből (mvn dependency:tree) mert ütközik másik csomaggal.
<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.10-FINAL</version> <exclusions> <exclusion> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> </exclusion> </exclusions> </dependency>
A Hibernate Core 5.0.7.Final csomagot adták a Wildfly 10.0.0.Final-hoz. Ajánlott a deltaspike használata is.
- A hozzászóláshoz be kell jelentkezni