使用Maven的Java存储库:缺少工件:compile
我试图将我的Maven Webapp中的 jersey-server
和 grizzly-servlet-webserver
一个地狱世界与 JAX-RS
。不幸的是,泽西和灰熊的依赖是麻烦而不是工作。
I am trying to intigrate jersey-server
and the grizzly-servlet-webserver
into my Maven Webapp to try a hellworld with JAX-RS
. Unfortunately the Jersey and Grizzly dependencies are trouble and not working.
我尝试删除 .m2
文件夹,因为我认为它可能被破坏,这没有帮助。我添加了其他依赖关系,如jsoup,工作正常。在日志中,它实际上是从存储库中下载jersey-server,因此它不是网络问题。
I tried deleting the .m2
folder because I thought it might be corrupted which did not help. I added other dependencies like jsoup which works fine. In the log it actually downloads jersey-server from the repository so its not a networking issue.
有人可以帮助我吗?我真的卡住了!
Can anybody help me? I am really stuck!
我的Eclipse日志
14.07.11 18:31:33 MESZ: Refreshing [/server/pom.xml]
14.07.11 18:31:33 MESZ: Missing artifact com.sun.jersey:jersey-server:jar:1.8:compile
14.07.11 18:31:33 MESZ: Missing artifact com.sun.grizzly:grizzly-servlet-webserver:jar:1.9.18-i:compile
14.07.11 18:31:33 MESZ: Missing artifact com.sun.grizzly:grizzly-utils:jar:1.9.18-i:compile
14.07.11 18:31:33 MESZ: Maven Builder: AUTO_BUILD
14.07.11 18:31:42 MESZ: Updated index for central|http://repo1.maven.org/maven2
...它下载的较早的部分:
... an earlier part where it downloads:
.07.11 18:08:25 MESZ: Downloaded http://download.java.net/maven/2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:26 MESZ: Downloading http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:26 MESZ: Downloaded http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
14.07.11 18:08:27 MESZ: Downloading http://download.java.net/maven/2/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.jar
14.07.11 18:08:27 MESZ: Downloaded http://download.java.net/maven/2/asm/asm/3.1/asm-3.1.jar
14.07.11 18:08:28 MESZ: Downloading http://download.java.net/maven/2/com/sun/jersey/jersey-core/1.8/jersey-core-1.8.jar
14.07.11 18:08:29 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-servlet-webserver/1.9.18-i/grizzly-servlet-webserver-1.9.18-i.jar
14.07.11 18:08:30 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-http/1.9.18-i/grizzly-http-1.9.18-i.jar
14.07.11 18:08:31 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-framework/1.9.18-i/grizzly-framework-1.9.18-i.jar
14.07.11 18:08:33 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-rcm/1.9.18-i/grizzly-rcm-1.9.18-i.jar
14.07.11 18:08:34 MESZ: Downloaded http://download.java.net/maven/2/com/sun/grizzly/grizzly-rcm/1.9.18-i/grizzly-rcm-1.9.18-i.jar
14.07.11 18:08:35 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-portunif/1.9.18-i/grizzly-portunif-1.9.18-i.jar
14.07.11 18:08:37 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-http-servlet/1.9.18-i/grizzly-http-servlet-1.9.18-i.jar
14.07.11 18:08:37 MESZ: Downloading http://download.java.net/maven/2/com/sun/grizzly/grizzly-utils/1.9.18-i/grizzly-utils-1.9.18-i.jar
14.07.11 18:08:38 MESZ: Downloaded http://download.java.net/maven/2/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
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>com.e.api</groupId>
<artifactId>server</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>server Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-servlet-webserver</artifactId>
<version>1.9.18-i</version>
</dependency>
</dependencies>
<build>
<finalName>server</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>maven-repository.java.net</id>
<name>Java.net Maven 1 Repository (legacy)</name>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
</repositories>
</project>
如果您显式运行Maven,您是否看到同样的问题(而不是M2E自动运行)?如果没有,您可能需要更新项目配置(选择proj,右键单击,Maven..Update..Project配置和Maven..Update..Project依赖关系。
Do you see the same problem if you explicitly run Maven (as opposed to the M2E autorun)? If not, you probably need to update the project config (select proj, right-click, Maven..Update..Project Configuration and Maven..Update..Project Dependencies.