2017-05-22 16 views
0

jenkins를 사용하여 내 maven 프로젝트의 war 파일을 크레이트 할 수 없습니다. jenkins를 사용하여 war 파일을 만드는 데 필요한 적절한 단계를 설명하는 사람을 도와 줄 수 있습니까? tomcat7, apache-maven-3.3.9 및 jenkins를 사용하고 있습니다. 나는 또한 젠킨스에 deploye 플러그인을 설치했다. E : jenkins를 사용하여 war 파일을 만들 수 없습니다.

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> 

날 해결책을 알려주세요 \ SOFTWARE \ tomcat7 \ tomcat7 \ conf의 \ 바람둥이 사용자 ... I 젠킨스에 새로운 ...

+0

젠킨스와는 아무런 관련이 없습니다. 이것은 maven이 수행합니다. Maven을 사용하여 war 파일을 로컬로 생성 할 수 있습니까? – haschibaschi

+0

pom.xml에서 jar을 제거하고 다시 시도하십시오. – Suresh

+0

다음 코드를 pom.xml에 추가하면 효과가있었습니다. – sushmita

답변

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>