1

我目前正在开发一个使用 maven 来管理依赖项的 java 项目。

在这个项目中,我想使用 javabuilders 库。根据文档,我的pom.xml文件应如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<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>fr.my.app</groupId>
  <artifactId>test</artifactId>
  <version>1.0</version>

  <repositories>
    <repository>
      <id>jcenter</id>
      <url>http://jcenter.bintray.com/</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>javabuilders</groupId>
      <artifactId>core</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>javabuilders</groupId>
      <artifactId>swing-core</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>javabuilders</groupId>
      <artifactId>swing-glazedlists</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.8.2</version>
    </dependency>
  </dependencies>

  <build>
  <resources>
    <resource>
      <directory>src/main/java</directory>
      <includes>
        <include>**/*</include>
      </includes>
      <excludes>
        <exclude>**/*.java</exclude>
      </excludes>
    </resource>
  </resources>
  <testResources>
    <testResource>
      <directory>src/test/java</directory>
      <includes>
        <include>**/*</include>
      </includes>
      <excludes>
        <exclude>**/*.java</exclude>
      </excludes>
    </testResource>
  </testResources>
  <plugins>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
      <compilerVersion>1.6</compilerVersion>
      <source>1.6</source>
      <target>1.6</target>
      <includes>
        <include>**/*.yml</include>
        <include>**/*.java</include>
      </includes>
      </configuration>
    </plugin>
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <configuration>
      </configuration>
    </plugin>
  </plugins>
  </build>
</project>

问题是找不到依赖项:

javabuilders:swing-core:1.3.0 未找到。

似乎没有在jcenter中搜索依赖项。我应该在我的pom.xml文件中添加更多内容还是添加到我的settings.xml文件中?

预先感谢您的帮助 !

4

0 回答 0