我无法使用jenkins创建我的maven项目的war文件。 任何人都可以帮我描述使用jenkins创建war文件所需的正确步骤。 我正在使用tomcat7,apache-maven-3.3.9和jenkins。 我还在jenkins中插入了deploye插件。 E:\ SOFTWARE \ tomcat7 \ tomcat7 \的conf \ tomcat的用户
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的新手......
答案 0 :(得分:0)
I added the following code in pom.xml and it worked....
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>deploy-node-modules-artifact</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy_package</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy file="target/springtest.war"
todir="E:/software/tomcat-7/tomcat7/webapps"/></tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>central</id>
<name>plugins-releases</name>
<url>http://serverip:8081/artifactory/plugins-release-local</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://serverip:8081/artifactory/plugins-snapshot-local</url>
</snapshotRepository>
</distributionManagement>