为了处理语言语料库,我需要能够在Pepper模块中使用de.tudarmstadt.ukp.dkpro.core库。 我按照Pepper文档https://korpling.github.io/pepper/doc/index.html中的说明进行操作,并尝试将DKPro依赖项包括到我的Pepper模块的pom.xml中(请参阅下面的pom.xml内容)。不幸的是,我遇到了一些错误,这些是Maven的新手,我无法解决。
当我使用命令mvn clean install -U
构建Pepper模块时,一切似乎进展顺利。 mvn dependency:copy-dependencies
也是一样。 Maven将所有依赖项复制到我添加到pepper.properties文件的路径的文件夹MyPepperModuleHome/target/dependency
中:
pepper.dropin.paths=/home/nadiushka/pepper/PepperDKproConfig/target/,/home/nadiushka/pepper/PepperDKproConfig/target/dependency/
但是,当我启动Pepper时,它抱怨未解决的依赖关系(请参见下面的错误)。 对于解决此问题的任何帮助,我将非常感激。 也许您知道DKPro已成功集成到Pepper模块中的项目?
非常感谢您!
这是我启动Pepper时遇到的错误:
018-11-28 10:45:27,588 WARN [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:657] The bundle 'org.springframework.context-3.1.2.RELEASE' wasn't started correctly. The bundle is located at 'file:/home/nadiushka/pepper/PepperDKproConfig/target/dependency/spring-context-3.1.2.RELEASE.jar'. This could cause other problems. For more details turn on log mode to debug and see log file.
org.osgi.framework.BundleException: The bundle "org.springframework.context_3.1.2.RELEASE [93]" could not be resolved. Reason: Missing Constraint: Import-Package: org.springframework.beans; version="[3.1.2,3.1.3)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.start(PepperOSGiConnector.java:655)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.startBundles(PepperOSGiConnector.java:688)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.init(PepperOSGiConnector.java:174)
at org.corpus_tools.pepper.cli.PepperStarter.setPepper(PepperStarter.java:130)
at org.corpus_tools.pepper.cli.PepperStarter.main(PepperStarter.java:1381)
2018-11-28 10:45:27,589 ERROR [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:666] The bundle 'org.springframework.context-3.1.2.RELEASE' wasn't started correctly.
2018-11-28 10:45:27,590 WARN [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:657] The bundle 'org.sonatype.inject.plexus-2.1.1' wasn't started correctly. The bundle is located at 'file:/home/nadiushka/pepper/PepperDKproConfig/target/dependency/sisu-inject-plexus-2.1.1.jar'. This could cause other problems. For more details turn on log mode to debug and see log file.
org.osgi.framework.BundleException: A fragment bundle cannot be started: org.sonatype.inject.plexus_2.1.1 [105]
at org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:224)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.start(PepperOSGiConnector.java:655)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.startBundles(PepperOSGiConnector.java:688)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.init(PepperOSGiConnector.java:174)
at org.corpus_tools.pepper.cli.PepperStarter.setPepper(PepperStarter.java:130)
at org.corpus_tools.pepper.cli.PepperStarter.main(PepperStarter.java:1381)
2018-11-28 10:45:27,590 ERROR [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:666] The bundle 'org.sonatype.inject.plexus-2.1.1' wasn't started correctly.
2018-11-28 10:45:27,799 WARN [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:657] The bundle 'com.carrotgarden.osgi.carrot-osgi-anno-scr-make-2.0.2' wasn't started correctly. The bundle is located at 'file:/home/nadiushka/pepper/PepperDKproConfig/target/dependency/carrot-osgi-anno-scr-make-2.0.2.jar'. This could cause other problems. For more details turn on log mode to debug and see log file.
org.osgi.framework.BundleException: The bundle "com.carrotgarden.osgi.carrot-osgi-anno-scr-make_2.0.2 [142]" could not be resolved. Reason: Missing Constraint: Import-Package: com.thoughtworks.xstream.annotations; version="0.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:292)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.start(PepperOSGiConnector.java:655)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.startBundles(PepperOSGiConnector.java:688)
at org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.init(PepperOSGiConnector.java:174)
at org.corpus_tools.pepper.cli.PepperStarter.setPepper(PepperStarter.java:130)
at org.corpus_tools.pepper.cli.PepperStarter.main(PepperStarter.java:1381)
2018-11-28 10:45:27,800 ERROR [main] o.c.p.c.i.PepperOSGiConnector [PepperOSGiConnector.java:666] The bundle 'com.carrotgarden.osgi.carrot-osgi-anno-scr-make-2.0.2' wasn't started correctly.
这是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>PepperDKproConfig</groupId>
<artifactId>PepperDKproConfig</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>PepperDKproConfig.PepperDKproConfig</name>
<!-- Declares this project to be an extension of the project pepper-parentModule. -->
<parent>
<groupId>org.corpus-tools</groupId>
<artifactId>pepper-parentModule</artifactId>
<version>3.1.0</version>
</parent>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<organization>
<name>EuracResearch</name>
</organization>
<developers>
<developer>
<name>NadezdaOkinina</name>
<organization>EuracResearch</organization>
</developer>
</developers>
<properties>
<dkpro.core.version>1.10.0</dkpro.core.version>
<uima.version>2.9.0</uima.version>
</properties>
<dependencies>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core-asl</artifactId>
<version>${dkpro.core.version}</version>
<type>pom</type>
<!--<scope>import</scope>-->
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>1.2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.opennlp-asl</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.languagetool-asl</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.maltparser-asl</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.text-asl</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.dkpro.core</groupId>
<artifactId>de.tudarmstadt.ukp.dkpro.core.io.conll-asl</artifactId>
<version>1.10.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.uima/uimafit-core -->
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimafit-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-core</artifactId>
<version>${uima.version}</version>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-document-annotation</artifactId>
<version>${uima.version}</version>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>jcasgen-maven-plugin</artifactId>
<version>${uima.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<manifestLocation>${META-INF}</manifestLocation>
<source>${java.version}</source>
<target>${java.version}</target>
<instructions>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId};singleton:=true</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-RequiredExecutionEnvironment>JavaSE-${java.version}</Bundle-RequiredExecutionEnvironment>
<Service-Component>${allServiceComponents}</Service-Component>
<Embed-Dependency>cn.com.cjf,com.ibm.icu.text,de.tudarmstadt.ukp.dkpro.core.api.anomaly.type, de.tudarmstadt.ukp.dkpro.core.api.coref.type,
de.tudarmstadt.ukp.dkpro.core.api.featurepath, de.tudarmstadt.ukp.dkpro.core.api.frequency.util,
de.tudarmstadt.ukp.dkpro.core.api.io,
de.tudarmstadt.ukp.dkpro.core.api.io.sequencegenerator,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.pos,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.morph,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos,
de.tudarmstadt.ukp.dkpro.core.api.metadata,
de.tudarmstadt.ukp.dkpro.core.api.metadata.type,
de.tudarmstadt.ukp.dkpro.core.api.ner.type,
de.tudarmstadt.ukp.dkpro.core.api.parameter,
de.tudarmstadt.ukp.dkpro.core.api.resources,
de.tudarmstadt.ukp.dkpro.core.api.segmentation,
de.tudarmstadt.ukp.dkpro.core.api.segmentation.type,
de.tudarmstadt.ukp.dkpro.core.api.semantics.type,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.chunk,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency,
de.tudarmstadt.ukp.dkpro.core.api.transform,
de.tudarmstadt.ukp.dkpro.core.io.penntree,
de.tudarmstadt.ukp.dkpro.core.io.text,
eu.openminted.share.annotations.api,
de.tudarmstadt.ukp.dkpro.core.io.conll,
de.tudarmstadt.ukp.dkpro.core.languagetool,
de.tudarmstadt.ukp.dkpro.core.maltparser,
de.tudarmstadt.ukp.dkpro.core.opennlp,
it.unimi.dsi.fastutil.ints,
it.unimi.dsi.fastutil.objects,
opennlp.tools.chunker,
opennlp.tools.dictionary,
opennlp.tools.lemmatizer,
opennlp.tools.ml.model,
opennlp.tools.namefind,
opennlp.tools.parser,
opennlp.tools.postag,
opennlp.tools.sentdetect,
opennlp.tools.tokenize,
opennlp.tools.util,
opennlp.tools.util.model,
org.apache.uima,
org.apache.uima.analysis_engine,
org.apache.uima.collection,
org.apache.uima.fit.factory,
org.apache.uima.fit.pipeline,
org.apache.uima.resource,
org.apache.uima.resource.ResourceInitializationException,
org.springframework.beans,
org.aopalliance.aop,
com.thoughtworks.xstream
</Embed-Dependency>
<Bundle-ClassPath>.,{maven-dependencies} </Bundle-ClassPath>
<Include-Resource> {maven-resources}, {maven-dependencies}</Include-Resource>
<_exportcontents>
cn.com.cjf,com.ibm.icu.text, de.tudarmstadt.ukp.dkpro.core.api.anomaly.type,
de.tudarmstadt.ukp.dkpro.core.api.featurepath, de.tudarmstadt.ukp.dkpro.core.api.frequency.util,de.tudarmstadt.ukp.dkpro.core.api.coref.type,
de.tudarmstadt.ukp.dkpro.core.api.io,
de.tudarmstadt.ukp.dkpro.core.api.io.sequencegenerator,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.pos,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.morph,
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos,
de.tudarmstadt.ukp.dkpro.core.api.metadata,
de.tudarmstadt.ukp.dkpro.core.api.metadata.type,
de.tudarmstadt.ukp.dkpro.core.api.ner.type,
de.tudarmstadt.ukp.dkpro.core.api.parameter,
de.tudarmstadt.ukp.dkpro.core.api.resources,
de.tudarmstadt.ukp.dkpro.core.api.segmentation,
de.tudarmstadt.ukp.dkpro.core.api.segmentation.type,
de.tudarmstadt.ukp.dkpro.core.api.semantics.type,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.chunk,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent,
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency,
de.tudarmstadt.ukp.dkpro.core.api.transform,
de.tudarmstadt.ukp.dkpro.core.io.penntree,
de.tudarmstadt.ukp.dkpro.core.io.text,
eu.openminted.share.annotations.api,
de.tudarmstadt.ukp.dkpro.core.io.conll,
de.tudarmstadt.ukp.dkpro.core.languagetool,
de.tudarmstadt.ukp.dkpro.core.maltparser,
de.tudarmstadt.ukp.dkpro.core.opennlp,
it.unimi.dsi.fastutil.ints,
it.unimi.dsi.fastutil.objects,
opennlp.tools.chunker,
opennlp.tools.dictionary,
opennlp.tools.lemmatizer,
opennlp.tools.ml.model,
opennlp.tools.namefind,
opennlp.tools.parser,
opennlp.tools.postag,
opennlp.tools.sentdetect,
opennlp.tools.tokenize,
opennlp.tools.util,
opennlp.tools.util.model,
org.apache.uima,
org.apache.uima.analysis_engine,
org.apache.uima.collection,
org.apache.uima.fit.factory,
org.apache.uima.fit.pipeline,
org.apache.uima.resource,
org.apache.uima.resource.ResourceInitializationException,
org.springframework.beans,
org.aopalliance.aop,
com.thoughtworks.xstream
</_exportcontents>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>