2014-08-29 3 views
0

Я пытаюсь настроить проект maven с Джерси 2.5 в эклипзе Luna.Tomcat 7 maven build не удалось с Джерси

Здесь может 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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>MavenTest</groupId> 
    <artifactId>Jersey Project</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>MC-Server Maven Webapp</name> 

    <url>http://maven.apache.org</url> 

     <pluginRepositories> 
     <pluginRepository> 
     <id>apache.snapshots</id> 
     <name>Apache Snapshots</name> 
     <url>http://people.apache.org/repo/m2-snapshot-repository</url> 
     <releases> 
     <enabled>false</enabled> 
     </releases> 
     <snapshots> 
     <enabled>true</enabled> 
     </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 


    <build> 
    <finalName>MavenJerseyTest</finalName> 

    <plugins>   
     <plugin> 
      <groupId>org.apache.tomcat.maven</groupId> 
      <artifactId>tomcat7-maven-plugin</artifactId> 
      <version>2.1</version>  
     </plugin>      
    </plugins>  

    </build> 

    <dependencies> 
    <dependency> 
<groupId>org.glassfish.jersey.containers</groupId> 
<artifactId>jersey-container-servlet</artifactId> 
<version>2.5.1</version> 
</dependency> 
    </dependencies> 

</project>  

Когда я строю это

[INFO] Scanning for projects... 
[WARNING] The POM for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:7 is missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.apache.tomcat.maven:tomcat7-maven-plugin:7: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:7 or one of its dependencies could not be resolved: Failure to find org.apache.tomcat.maven:tomcat7-maven-plugin:jar:7 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 
[INFO] Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/plugins/maven-metadata.xml 
[INFO] Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/codehaus/mojo/maven-metadata.xml 
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[INFO] Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/codehaus/mojo/tomcat-maven-plugin/maven-metadata.xml 
[WARNING] Could not transfer metadata org.codehaus.mojo:tomcat-maven-plugin/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building MC-Server Maven Webapp 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[WARNING] The POM for org.apache.tomcat.maven:tomcat7-maven-plugin:jar:7 is missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.apache.tomcat.maven:tomcat7-maven-plugin:7: Plugin org.apache.tomcat.maven:tomcat7-maven-plugin:7 or one of its dependencies could not be resolved: Failure to find org.apache.tomcat.maven:tomcat7-maven-plugin:jar:7 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://people.apache.org/repo/m2-snapshot-repository was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://people.apache.org/repo/m2-snapshot-repository was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[WARNING] Failure to transfer org.codehaus.mojo:tomcat-maven-plugin/maven-metadata.xml from http://people.apache.org/repo/m2-snapshot-repository was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo:tomcat-maven-plugin/maven-metadata.xml from/to apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository): connect timed out 
[INFO] 
[INFO] >>> tomcat-maven-plugin:1.1:run (default-cli) @ MC-Server >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ MC-Server --- 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is plat 
form dependent! 
[INFO] Copying 3 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ MC-Server --- 
[INFO] No sources to compile 
[INFO] 
[INFO] <<< tomcat-maven-plugin:1.1:run (default-cli) @ MC-Server <<< 
[INFO] 
[INFO] --- tomcat-maven-plugin:1.1:run (default-cli) @ MC-Server --- 
[INFO] Running war on http://localhost:8080/MavenJerseyTest 
[INFO] Creating Tomcat server configuration at /myprojects/maven/MavenJerseyTest/target/tomcat  

Это, казалось, не работает с котом 7, но 6.

Любой, дайте мне знать где я поступил неправильно? (Эта же структура проекта может быть построена как веб-проект noraml в eclipse и работает спокойно, также есть такой же вопрос, как this, но я попробовал их, не работая. Я изменил версию плагина tomcat как 2.1, которая была предложена в качестве ответа в другом вопросе, он также не работал ..)

ответ

2

Этого не может быть из-за Джерси. Изменение pom.xml для кота плагина

<plugin> 
      <groupId>org.apache.tomcat.maven</groupId> 
      <artifactId>tomcat7-maven-plugin</artifactId> 
      <version>2.2</version> 
     </plugin> 

и TOMCAT цели: tomcat7:redeploy

Смежные вопросы