【发布时间】:2017-05-22 05:58:21
【问题描述】:
我无法使用 jenkins 创建我的 maven 项目的战争文件。 谁能帮我描述使用詹金斯创建战争文件所需的正确步骤。 我正在使用 tomcat7、apache-maven-3.3.9 和 jenkins。 我还在 jenkins 中安装了 deploye 插件。 E:\software\tomcat-7\tomcat7\conf\tomcat-user
E:\software\tomcat-7\tomcat7\webapps\apache-maven-3.3.9\conf\settings.xml
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>password</password>
</server>
pom.xml--
<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.java.ex</groupId>
<artifactId>springtest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>springtest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.0.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.0.9.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --
>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.0.9.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
请告诉我解决方案...我是 jenkins 的新手...
【问题讨论】:
-
war文件的创建与jenkins无关。这是由 Maven 完成的。可以用maven在本地创建war文件吗?
-
从 pom.xml 中删除
jar 并重试。 -
我在 pom.xml 中添加了以下代码,它工作了....
标签: java spring-mvc jenkins maven-tomcat-plugin