2017-07-28 52 views
0

我正在嘗試利用Apache Spark應用程序中spark-xml-utils庫提供的功能。我無法在我的mavenized spark-scala項目中獲得spark-xml-utils庫。我的pom.xml的配置是: -無法獲得工件com.elsevier:spark-xml-utils:jar:1.6.0

<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.alpha.beta</groupId> 
    <artifactId>spark2</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 

    <pluginRepositories> 
    <pluginRepository> 
     <id>scala-tools.org</id> 
     <name>Scala-tools Maven2 Repository</name> 
     <url>http://scala-tools.org/repo-releases</url> 
    </pluginRepository> 
    </pluginRepositories> 

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

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

    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.spark</groupId> 
     <artifactId>spark-core_2.10</artifactId> 
     <version>1.4.0</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/org.apache.spark/spark-sql_2.10 --> 
    <dependency> 
     <groupId>org.apache.spark</groupId> 
     <artifactId>spark-sql_2.10</artifactId> 
     <version>1.4.0</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/com.databricks/spark-csv_2.10 --> 
    <dependency> 
     <groupId>com.databricks</groupId> 
     <artifactId>spark-csv_2.10</artifactId> 
     <version>1.4.0</version> 
    </dependency> 
    <!-- https://mvnrepository.com/artifact/elsevierlabs-os/spark-xml-utils --> 
    <dependency> 
     <groupId>com.elsevier</groupId> 
     <artifactId>spark-xml-utils</artifactId> 
     <version>1.6.0</version> 
    </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <!-- mixed scala/java compile --> 
      <plugin> 
       <groupId>org.scala-tools</groupId> 
       <artifactId>maven-scala-plugin</artifactId> 
       <executions> 
        <execution> 
         <id>compile</id> 
         <goals> 
          <goal>compile</goal> 
         </goals> 
         <phase>compile</phase> 
        </execution> 
        <execution> 
         <id>test-compile</id> 
         <goals> 
          <goal>testCompile</goal> 
         </goals> 
         <phase>test-compile</phase> 
        </execution> 
        <execution> 
         <phase>process-resources</phase> 
         <goals> 
          <goal>compile</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <!-- for fatjar --> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-assembly-plugin</artifactId> 
       <version>2.4</version> 
       <configuration> 
        <descriptorRefs> 
         <descriptorRef>jar-with-dependencies</descriptorRef> 
        </descriptorRefs> 
       </configuration> 
       <executions> 
        <execution> 
         <id>assemble-all</id> 
         <phase>package</phase> 
         <goals> 
          <goal>single</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-jar-plugin</artifactId> 
       <configuration> 
        <archive> 
         <manifest> 
          <addClasspath>true</addClasspath> 
          <mainClass>fully.qualified.MainClass</mainClass> 
         </manifest> 
        </archive> 
       </configuration> 
      </plugin> 
     </plugins> 
     <pluginManagement> 
      <plugins> 
       <!--This plugin's configuration is used to store Eclipse m2e settings 
        only. It has no influence on the Maven build itself. --> 
       <plugin> 
        <groupId>org.eclipse.m2e</groupId> 
        <artifactId>lifecycle-mapping</artifactId> 
        <version>1.0.0</version> 
        <configuration> 
         <lifecycleMappingMetadata> 
          <pluginExecutions> 
           <pluginExecution> 
            <pluginExecutionFilter> 
             <groupId>org.scala-tools</groupId> 
             <artifactId> maven-scala-plugin </artifactId> 
             <versionRange> [2.15.2,) </versionRange> 
             <goals> 
              <goal>compile</goal> 
              <goal>testCompile</goal> 
             </goals> 
            </pluginExecutionFilter> 
            <action> 
             <execute /> 
            </action> 
           </pluginExecution> 
          </pluginExecutions> 
         </lifecycleMappingMetadata> 
        </configuration> 
       </plugin> 
      </plugins> 
     </pluginManagement> 
    </build> 
</project> 

我得到一個丟失的神器com.elsevier:火花XML-utils的:罈子:1.6.0錯誤。難道我做錯了什麼?我相信這不是網絡或防火牆問題。

回答

1

羣組標識是錯誤的 - 它應該是elsevierlabs-OS沒有com.elsevier

<dependency> 
    <groupId>elsevierlabs-os</groupId> 
    <artifactId>spark-xml-utils</artifactId> 
    <version>1.6.0</version> 
</dependency>