allenai / science-parse

Science Parse parses scientific papers (in PDF form) and returns them in structured form.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mvn dependency, missing dependencies

thomasegense opened this issue · comments

Using this dependency from the README.md file:

  <dependency>
       <groupId>org.allenai</groupId>
       <artifactId>science-parse_2.11</artifactId>
       <version>2.0.1</version>  
  </dependency>

Will result in a build error. The resources defined in this project are not uploaded to maven repository I think.

[WARNING] The POM for org.allenai.common:common-core_2.11:jar:1.4.9 is missing, no dependency information available
[WARNING] The POM for org.allenai:ml:jar:0.16 is missing, no dependency information available
[WARNING] The POM for org.allenai.datastore:datastore_2.11:jar:1.0.9 is missing, no dependency information available
[WARNING] The POM for com.medallia.word2vec:word2vecjava_2.11:jar:1.0-ALLENAI-4 is missing, no dependency information available
[WARNING] The POM for org.allenai:pdffigures2_2.11:jar:0.0.11 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.477 s
[INFO] Finished at: 2018-09-07T12:14:39+02:00
[INFO] Final Memory: 18M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project loarindexer: Could not resolve dependencies for project dk.kb.loar.loarindexer:loarindexer:war:1.0-SNAPSHOT: The following artifacts could not be resolved: org.allenai.common:common-core_2.11:jar:1.4.9, org.allenai:ml:jar:0.16, org.allenai.datastore:datastore_2.11:jar:1.0.9, com.medallia.word2vec:word2vecjava_2.11:jar:1.0-ALLENAI-4, org.allenai:pdffigures2_2.11:jar:0.0.11:....
[ERROR]

Adding this repository to the POM as I can see another issue has addressed does not solve the problem for me:

  <repository>
            <id>org.allenai</id>
            <url>https://bintray.com/allenai/maven</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

It gives this error:
ERROR] error: error reading /home/teg/.m2/repository/org/allenai/common/common-core_2.11/1.4.9/common-core_2.11-1.4.9.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/ml/0.16/ml-0.16.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/datastore/datastore_2.11/1.0.9/datastore_2.11-1.0.9.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/com/medallia/word2vec/word2vecjava_2.11/1.0-ALLENAI-4/word2vecjava_2.11-1.0-ALLENAI-4.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/pdffigures2_2.11/0.0.11/pdffigures2_2.11-0.0.11.jar; error in opening zip file
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.143 s
[INFO] Finished at: 2018-09-07T12:36:59+02:00
[INFO] Final Memory: 25M/323M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project loarindexer: Compilation failure: Compilation failure:
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/common/common-core_2.11/1.4.9/common-core_2.11-1.4.9.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/ml/0.16/ml-0.16.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/datastore/datastore_2.11/1.0.9/datastore_2.11-1.0.9.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/com/medallia/word2vec/word2vecjava_2.11/1.0-ALLENAI-4/word2vecjava_2.11-1.0-ALLENAI-4.jar; error in opening zip file
[ERROR] error: error reading /home/teg/.m2/repository/org/allenai/pdffigures2_2.11/0.0.11/pdffigures2_2.11-0.0.11.jar; error in opening zip file

When maven downloads (after I delete the .m2 folders) I see this text:
[WARNING] The POM for org.allenai.common:common-core_2.11:jar:1.4.9 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.allenai:ml:jar:0.16 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.allenai.datastore:datastore_2.11:jar:1.0.9 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.medallia.word2vec:word2vecjava_2.11:jar:1.0-ALLENAI-4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.allenai:pdffigures2_2.11:jar:0.0.11 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

I got it up and running. The problem is that the maven pom includes multiple different versions of third party jars. And it fails if the classloader finds the wrong one first. I had to clean up and add the following in my pom:

  <dependencies>   
     <dependency>
       <groupId>org.allenai</groupId>
       <artifactId>science-parse_2.11</artifactId>
       <version>2.0.1</version>  
       <exclusions>      
         <exclusion>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-databin</artifactId>      
       </exclusion>
    </exclusions>  
  </dependency>
  
  <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.6.0</version>
 </dependency>
  
  <dependency>
    <groupId>org.apache.pdfbox</groupId>
    <artifactId>pdfbox</artifactId>
    <version>2.0.9</version>
    <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
  </dependency>
              ```

I am looking at the pom right here: https://search.maven.org/artifact/org.allenai/science-parse_2.11/2.0.3/jar

I don't see either pdfbox or jackson-databind specified more than once. Is it possible that your project pulled in those dependencies in some other way, and that's why you're having conflicts?

I also encounter same problem when using this dependency from the README.md file.

These are the errors:

  • Missing artifact org.allenai:pdffigures2_2.11:jar:0.0.11
  • Missing artifact com.medallia.word2vec:word2vecjava_2.11:jar:1.0-ALLENAI-4
  • Missing artifact org.allenai:ml:jar:0.16
  • Missing artifact org.allenai.common:common-core_2.11:jar:1.4.9

@asmaada You should include Spring Plugins repository as these four artifacts are located in this repository. You can do that by adding the following snippet to your pom.xml:

<repositories>
    <repository>
        <id>SpringPlugins</id>
        <name>Spring Plugins Repository</name>
        <url>http://repo.spring.io/plugins-release/</url>
    </repository>
</repositories>