我有一个非常简单的WAR项目,我想META-INF在类输出文件夹的顶部包含一个目录,其中包含所有已编译的Java类.我正在使用Maven,但似乎默认情况下Maven不会包含任何不是Java类的内容.所以它忽略了我META-INF位于src目录顶部的目录.该META-INF目录包含一个名为的文件persistence.xml.有关如何指示Maven将此目录和文件放入输出文件夹的快速指示?
我正在构建一个 Java Spring 启动项目 - 作为一项要求,我需要将该项目生成为一个 war 文件 - 然后让 Tomcat Apache 单独运行。
我已经构建了 war 文件,但是当我尝试部署它时,它好像结构不正确并且它生成 404 试图查看项目。
我的绒球
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>org.springframework</groupId>
<artifactId>gs-spring-boot</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
</parent>
<dependencies>
<!-- web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.0-api -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<!-- mysql connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- mail …Run Code Online (Sandbox Code Playgroud)