我有以下错误导致项目上出现感叹号红点,并显示在问题/标记视图中。
'....m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar' ... 无法读取或不是有效的 ZIP 文件
我已经检查了存储库并且 jta-1.0.1B.jar 在那里,我不明白为什么它无法读取。我之前在这个 jar 文件上遇到了一个不同的问题,以及 stax-1.0.jar 等其他依赖项,并搜索了类似的问题,我发现这是由在每个文件末尾添加 .lastUpdated 的名称引起的。我通过仅删除 .lastUpdated 手动重命名它们。之后,日志中的构建显示成功,但我仍然在标记视图中看到错误,并在项目上看到由所列问题引起的感叹号红点。我试过这个解决方案:
查看 Java.net maven 2 存储库。 http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/
将 .jar、.jar.md5 和 .jar.sha1 下载到您 [.m2/javax/transaction/jta/1.0.1B/]
利用:
mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -Dfile=jta-1.0.1B.jar
但我仍然有同样的问题。我该如何进行?注意:这是我通过运行 Maven clean 在控制台中得到的 [为什么它构建成功并且问题仍然存在?
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for prep.mucyo.com:subscription:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.oracle:ojdbc14:jar should use a variable instead of a hard-coded path C:/Eclipse_Juno/workspace/subscription/lib/ojdbc14.jar @ line 84, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building subscription maven webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ subscription ---
[INFO] Deleting C:\Eclipse_Juno\workspace\subscription\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.645s
[INFO] Finished at: Thu Aug 15 15:45:22 EDT 2013
[INFO] Final Memory: 3M/60M
[INFO] ------------------------------------------------------------------------
这是 pom.xml 的一部分
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.com/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.15.1</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.15.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6.SEC03</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>20040902.021138</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>20040616</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>20030911</version>
</dependency>
<dependency>
<groupId>net.sf.stax</groupId>
<artifactId>stax</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>14</version>
<scope>system</scope>
<systemPath>C:/Eclipse_Juno/workspace/subscription/lib/ojdbc14.jar</systemPath>
</dependency>
</dependencies>
<build>
<finalName>subscription</finalName>
</build>