1

我正在关注此链接链接来运行我的休眠应用程序。虽然我已经添加了所有必需的依赖项,但它遇到了以下错误。

The following artifacts could not be resolved: javax.security:jacc:jar:1.0, 
javax.transaction:jta:jar:1.0.1B: Failure to find javax.security:jacc:jar:1.0 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 -> [Help 1]

netbeans 还在其属性窗口中显示以下消息。

问题: * 一些依赖项工件不在本地存储库中。

我的 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.myProject</groupId>
  <artifactId>hibernateTesting</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

       <dependencies>
    <dependency>
      <groupId>hibernate</groupId>
      <artifactId>hibernate</artifactId>
      <version>3.0</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
      <version>1.0.1.Final</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.grlea.log.adapters</groupId>
      <artifactId>simple-log-sl4j</artifactId>
      <version>1.7</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>javax.security</groupId>
      <artifactId>jacc</artifactId>
      <version>1.0</version>
      <type>jar</type>
    </dependency>
  </dependencies>
</project>
4

2 回答 2

1

尝试将此存储库添加到您的 pom.xml

<repositories>
  <repository>
    <id>JBoss Deprecated</id>
    <url>https://repository.jboss.org/nexus/content/repositories/deprecated</url>
  </repository>
  <repository>
    <id>java.net</id>
    <url>http://download.java.net/maven/2/</url>
  </repository>
</repositories>

JBoss 存储库将找到 javax.security.jcc 并且 java.net 存储库将具有 javax.transaction.jta jar

<repositories>标签可以放在<project>标签内的任何地方。我通常在 pom 的开头声明它们。

于 2013-02-22T06:05:02.117 回答
0

您可以尝试像这样清理并强制更新您的 Maven 存储库:

mvn clean -U
于 2013-02-22T05:36:54.530 回答