Maven无法解决依赖关系-缺少...的POM

时间:2019-02-24 06:15:34

标签: java pom.xml

我有两个软件包-一个叫做jhdf,另一个是src。我的主要位于src。但是,我运行mvn compile后,我的POM.XML一直给我错误:The POM for jhdf is missing, no dependency information available

我很确定这是我收到第二个错误的原因:Failed to execute goal on project test: Could not resolve dependencies for project edu.cs.test:0.3-SNAPSHOT: Could not find artifact edu.cs.jhdf:jhdf:jar:0.1-SNAPSHOT in osgeo (http://download.osgeo.org/webdav/geotools/)

这是我的POM.XML文件(如果您注意到我确实列出了我的jhdf依赖项):

<?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>edu.cs.test</groupId>
  <artifactId>test</artifactId>
  <version>0.3-SNAPSHOT</version>


  <repositories>

    <repository>
      <id>osgeo</id>
      <name>Open Source Geospatial Foundation Repository</name>
      <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>

  </repositories>

  <properties>
    <!--added new-->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <geotools.version>19-SNAPSHOT</geotools.version>

    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
    <geotools.version>17.0</geotools.version>
    <hadoop.version>2.8.0</hadoop.version>
  </properties>


  <dependencies>

      <!--added new-->
    <!--<dependency>-->
      <!--<groupId>it.geosolutions.imageio-ext</groupId>-->
      <!--<artifactId>imageio-ext-jhdfaccess</artifactId>-->
      <!--<version>1.0.8</version>-->
    <!--</dependency>-->
    <!--<dependency>-->
        <!--<groupId>io.jhdf</groupId>-->
        <!--<artifactId>jhdf</artifactId>-->
        <!--<version>0.3.0</version>-->
    <!--</dependency>-->

    <dependency>
      <groupId>edu.cs.jhdf</groupId>
      <artifactId>jhdf</artifactId>
      <version>0.1-SNAPSHOT</version>
    </dependency>


    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
      <version>1.9.13</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/org.geotools/gt-shapefile -->

    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-shapefile</artifactId>
      <version>${geotools.version}</version>
    </dependency>

    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-geotiff</artifactId>
      <version>${geotools.version}</version>
    </dependency>

    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-image</artifactId>
      <version>${geotools.version}</version>
    </dependency>

    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-epsg-hsql</artifactId>
      <version>${geotools.version}</version>
    </dependency>


    <!-- The following two artifacts are added to be able to read files directly from HDFS (in the future) -->
    <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <version>${hadoop.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-hdfs -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-hdfs</artifactId>
      <version>${hadoop.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/commons-cli/commons-cli -->
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.4</version>
    </dependency>

    <dependency>
      <groupId>javax.media</groupId>
      <artifactId>jai_core</artifactId>
      <version>1.1.3</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
     </dependency>

  </dependencies>

</project>

我在做什么错?我曾尝试研究类似的问题,例如[this]-但不走运。会有什么帮助,谢谢!

1 个答案:

答案 0 :(得分:1)

您似乎已删除了依赖项“ io.jhdf:jhdf:0.3.0”,该依赖关系可在https://repo1.maven.org/maven2/io/jhdf/jhdf/0.3.0/的maven中央存储库中找到

并将其替换为osgeo存储库中不可用的“ edu.ucr.cs.jhdf:jhdf:jar:0.1-SNAPSHOT”,因此您要查找的工件尚未在此处发布。

我还注意到osgeo repo没有edu / ucr路径,但是确实有
http://download.osgeo.org/webdav/geotools/edu/ucar/

尝试像这样回到Maven中心工件

  <!--added new-->
<!--<dependency>-->
  <!--<groupId>it.geosolutions.imageio-ext</groupId>-->
  <!--<artifactId>imageio-ext-jhdfaccess</artifactId>-->
  <!--<version>1.0.8</version>-->
<!--</dependency>-->

<dependency>
    <groupId>io.jhdf</groupId>
    <artifactId>jhdf</artifactId>
    <version>0.3.0</version>
</dependency>

<!--
<dependency>
  <groupId>edu.ucr.cs.jhdf</groupId>
  <artifactId>jhdf</artifactId>
  <version>0.1-SNAPSHOT</version>
</dependency>
-->