tikaアプリクラスの名前を変更しようとしています。クラスパスでクラスが重複しているため、ロードの競合があります。maven install -eを実行しようとすると、エラーが発生し、
org.apache.tika
クラスとして
com.test1.tika
pom.xmlファイルは次のように与えられます
<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.test1.tika</groupId>
<artifactId>tika-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tika-app</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.tika</groupId>
<artifactId>tika-app</artifactId>
<version>1.20</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<createSourcesJar>true</createSourcesJar>
<relocations>
<relocation>
<pattern>org.apache.tika.</pattern>
<shadedPattern>com.test1.tika.</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
mvn packageコマンドからのエラーは次のとおりです。
NativeMethodAccessorImpl.invoke0(ネイティブメソッド)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method。 java:498)org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)at org.codehaus org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)の.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)原因:org.objectwebのjava.lang.IllegalArgumentException .asm.ClassReader。(不明なソース)org.objectweb.asm.ClassReader。(不明なソース)org.objectweb.asm.ClassReader。(不明なソース)org.apache.maven.plugins.shade.DefaultShaderにあります。launchEnhanced(Launcher.java:289)at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)[エラー] [エラー] -Xスイッチを使用してMavenを再実行し、完全なデバッグログを有効にします。[エラー] [エラー]エラーと考えられる解決策の詳細については、次の記事をお読みください:[エラー] [ヘルプ1]http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
maven-compiler-pluginのバージョンを2.3から3.2.1に変更すると解決しました。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加