dkpro / dkpro-core

Collection of software components for natural language processing (NLP) based on the Apache UIMA framework.
https://dkpro.github.io/dkpro-core
Other
196 stars 67 forks source link

TreeTagger Component: adding model as managed dependency does not work under Windows #151

Closed reckart closed 9 years ago

reckart commented 9 years ago
Hi

Adding TreeTagger models as managed dependencies (as done in the unit tests of dkpro-asl)
does not seem to work - at least not under Windows.

See attached file with the relevant parts of the pom and the stack trace.

Adding the TreeTagger models this way - not in the <dependencyManagement> section -
 does work, however (under Windows):

  <dependency>
    <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
    <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-model-de</artifactId>
    <version>20121207.0</version>
  </dependency>

  <dependency>
    <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
    <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-bin</artifactId>
    <version>20130228.0</version>
    <type>jar</type>
    <scope>compile</scope>
  </dependency>

Best
Judith

Original issue reported on code.google.com by eckle.kohler on 2013-05-26 16:01:44


reckart commented 9 years ago
The model and binary dependencies must be "real" dependencies. Their versions may imported
from the "de.tudarmstadt.ukp.dkpro.core.treetagger-asl" artifact, which then must be
specified in the dependencyManagement section.

If you want to use managed dependencies, it should look like this:

<dependencies>
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-bin</artifactId>
    </dependency>           
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-model-de</artifactId>
    </dependency>
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-model-en</artifactId>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
            <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-asl</artifactId>
            <version>1.4.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
  </dependencyManagement>

This strategy ensures that you always get compatible model/binary versions when you
upgrade to a new version of the DKPro Core TreeTagger component.

Original issue reported on code.google.com by richard.eckart on 2013-05-26 16:09:48

reckart commented 9 years ago
This does not work for me :(
I get the following errors (i.e. all classes in the project turned red):
I also tried to empty the local m2/repository, but it did not help.

Multiple annotations found at this line:
    - Project build error: 'dependencies.dependency.version' for de.tudarmstadt.ukp.dkpro.core:de.tudarmstadt.ukp.dkpro.core.treetagger-model-en:jar
is 
     missing.
    - Project build error: 'dependencies.dependency.version' for de.tudarmstadt.ukp.dkpro.core:de.tudarmstadt.ukp.dkpro.core.treetagger-bin:jar
is 
     missing.
    - Project build error: 'dependencies.dependency.version' for de.tudarmstadt.ukp.dkpro.core:de.tudarmstadt.ukp.dkpro.core.treetagger-model-de:jar
is 
     missing.

Original issue reported on code.google.com by eckle.kohler on 2013-05-26 17:35:44

reckart commented 9 years ago
That looks like you did not properly add this:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
            <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-asl</artifactId>
            <version>1.4.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
  </dependencyManagement>

Maybe you set the scope or type wrong or you used the wrong artifact, e.g. "de.tudarmstadt.ukp.dkpro.core-asl"
instead of "de.tudarmstadt.ukp.dkpro.core.treetagger-asl". The managed dependencies
are declared in the latter artifact as you can see here:

http://search.maven.org/remotecontent?filepath=de/tudarmstadt/ukp/dkpro/core/de.tudarmstadt.ukp.dkpro.core.treetagger-asl/1.4.0/de.tudarmstadt.ukp.dkpro.core.treetagger-asl-1.4.0.pom

Original issue reported on code.google.com by richard.eckart on 2013-05-26 18:35:14

reckart commented 9 years ago
thanks for your help, Richard - now it's working

However, in your first comment, one dependency is missing (without that the TreeTagger
components can not be found):
     <dependency>
         <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
         <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-asl</artifactId>
     </dependency>      

So to make the picture complete, it should like this:
<dependencies>
       <dependency>
                <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
                <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-asl</artifactId>
       </dependency>        
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-bin</artifactId>
    </dependency>           
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-model-de</artifactId>
    </dependency>
    <dependency>
        <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
        <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-model-en</artifactId>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
            <artifactId>de.tudarmstadt.ukp.dkpro.core.treetagger-asl</artifactId>
            <version>1.4.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
  </dependencyManagement>

Original issue reported on code.google.com by eckle.kohler on 2013-05-26 19:07:46

reckart commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by eckle.kohler on 2013-05-26 19:11:48

reckart commented 9 years ago
True, I was only explaining the dependency management for the resources (models/binaries),
not for the component itself.

Original issue reported on code.google.com by richard.eckart on 2013-05-26 19:13:06