【发布时间】:2016-02-16 10:08:32
【问题描述】:
我使用 Netbeans 创建了一个新的 Maven 项目。我在其中添加了一个pom.xml:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
如果在构建项目后我的项目树中没有 web.xml 是否正常,或者我应该对 glassfish.xml 进行相同的处理?
我怀疑我是不是搞砸了。
【问题讨论】:
-
您创建了什么类型的项目? maven 项目来自哪个原型?它是 webapp 原型吗? pom文件中描述了哪些项目打包?
-
@A.DiMatteo 这是战争包装 |我创建了一个网络应用程序 maven 项目
-
不,它本身不会创建 web.xml。您需要在“src/main/webapp/WEB-INF/”中创建一个