2018年8月21日 | Leave a comment 问题: thorntail (以前的wildfly-swarm ) hello world demo 解决: https://github.com/giant35/thorntail-hello pom.xml <?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> <groupId>com.qunfanyi</groupId> <artifactId>ws1</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <properties> <version.wildfly.swarm>2.1.0.Final</version.wildfly.swarm> <version.mysql>5.1.46</version.mysql> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <failOnMissingWebXml>false</failOnMissingWebXml> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>io.thorntail</groupId> <artifactId>bom-all</artifactId> <version>${version.wildfly.swarm}</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Wildfly Swarm Fractions --> <dependency> <groupId>io.thorntail</groupId> <artifactId>jaxrs</artifactId> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>jsf</artifactId> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>cdi</artifactId> </dependency> <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${version.mysql}</version> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>jpa</artifactId> </dependency>--> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <type>jar</type> <scope>provided</scope> </dependency> </dependencies> <build> <finalName>ws1</finalName> <plugins> <plugin> <groupId>io.thorntail</groupId> <artifactId>thorntail-maven-plugin</artifactId> <version>${version.wildfly.swarm}</version> <executions> <execution> <goals> <goal>package</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 <?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> <groupId>com.qunfanyi</groupId> <artifactId>ws1</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <properties> <version.wildfly.swarm>2.1.0.Final</version.wildfly.swarm> <version.mysql>5.1.46</version.mysql> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <failOnMissingWebXml>false</failOnMissingWebXml> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>io.thorntail</groupId> <artifactId>bom-all</artifactId> <version>${version.wildfly.swarm}</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Wildfly Swarm Fractions --> <dependency> <groupId>io.thorntail</groupId> <artifactId>jaxrs</artifactId> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>jsf</artifactId> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>cdi</artifactId> </dependency><!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${version.mysql}</version> </dependency> <dependency> <groupId>io.thorntail</groupId> <artifactId>jpa</artifactId> </dependency>--> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <type>jar</type> <scope>provided</scope> </dependency> </dependencies> <build> <finalName>ws1</finalName> <plugins> <plugin> <groupId>io.thorntail</groupId> <artifactId>thorntail-maven-plugin</artifactId> <version>${version.wildfly.swarm}</version> <executions> <execution> <goals> <goal>package</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> 参考: http://docs.wildfly-swarm.io/2.1.0.Final/#_jsf