eclipseにてMavenビルド実行時にエラーになる。
開発環境にてJavaプロジェクトをビルドし、Warファイルを作成したいと考えております。
JavaプロジェクトをeclipseにてMavenビルド(goal:Warファイルにpackage)したところ、エラーが発生いたしました。
Mavenでビルドさせたいのでpom.xmlに「maven-war-plugin」を追加しましたが、うまくビルドできません。
何かアドバイスを頂けるとありがたいです。
よろしくお願いいたします。
【開発環境】
CentOS:7.3
Java:11.0.3
Maven:3.5.3
eclipse:2019-03
【エラー内容】
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< sample:sample >--------------------------
[INFO] Building sample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ sample ---
[INFO] Deleting /home/adm/eclipse-workspace/sample/target
[INFO]
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ sample ---
[INFO] Source directory: /home/adm/eclipse-workspace/sample/src/core added.
[INFO] Source directory: /home/adm/eclipse-workspace/sample/src/web added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO] Copying 4 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ sample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 88 source files to /home/adm/eclipse-workspace/sample/target/classes
[INFO] /home/adm/eclipse-workspace/sample/src/web/jp/co/AAA/BBB/logic/business/ZipperBiz.java: /home/adm/eclipse-workspace/sample/src/web/jp/co/AAA/BBB/logic/business/ZipperBiz.javaは推奨されないAPIを使用またはオーバーライドしています。
[INFO] /home/adm/eclipse-workspace/sample/src/web/jp/co/AAA/BBB/logic/business/ZipperBiz.java: 詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/adm/eclipse-workspace/sample/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ sample ---
[INFO] Changes detected - recompiling the module!
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ sample ---
[INFO]
[INFO] --- maven-war-plugin:3.2.2:war (default-war) @ sample ---
[WARNING] Error injecting: org.apache.maven.plugins.war.WarMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.ExceptionInInitializerError
at org.apache.maven.plugins.war.WarMojo.<init>(Unknown Source)
while locating org.apache.maven.plugins.war.WarMojo
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
... more
Caused by: java.lang.NullPointerException
at java.base/sun.util.cldr.CLDRTimeZoneNameProviderImpl.toGMTFormat(CLDRTimeZoneNameProviderImpl.java:264)
at java.base/sun.util.cldr.CLDRTimeZoneNameProviderImpl.deriveFallbackName(CLDRTimeZoneNameProviderImpl.java:183)
at java.base/sun.util.cldr.CLDRTimeZoneNameProviderImpl.deriveFallbackNames(CLDRTimeZoneNameProviderImpl.java:145)
at java.base/sun.util.cldr.CLDRTimeZoneNameProviderImpl.getZoneStrings(CLDRTimeZoneNameProviderImpl.java:136)
at java.base/sun.util.locale.provider.TimeZoneNameUtility.loadZoneStrings(TimeZoneNameUtility.java:86)
at java.base/sun.util.locale.provider.TimeZoneNameUtility.getZoneStrings(TimeZoneNameUtility.java:72)
at java.base/java.text.DateFormatSymbols.getZoneStringsImpl(DateFormatSymbols.java:844)
at java.base/java.text.DateFormatSymbols.getZoneStringsWrapper(DateFormatSymbols.java:838)
at java.base/java.text.DateFormatSymbols.getZoneIndex(DateFormatSymbols.java:807)
at java.base/java.text.SimpleDateFormat.subParseZoneString(SimpleDateFormat.java:1731)
at java.base/java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2169)
at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1541)
at java.base/java.text.DateFormat.parse(DateFormat.java:393)
at com.thoughtworks.xstream.core.JVM.<clinit>(JVM.java:147)
... 64 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.261 s
[INFO] Finished at: 2019-05-13T17:15:49+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.2:war (default-war) on project sample: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:3.2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:3.2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-war-plugin:3.2.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/root/.m2/repository/org/apache/maven/plugins/maven-war-plugin/3.2.2/maven-war-plugin-3.2.2.jar
[ERROR] urls[1] = file:/root/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[2] = file:/root/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[3] = file:/root/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[4] = file:/root/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
[ERROR] urls[5] = file:/root/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[6] = file:/root/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[7] = file:/root/.m2/repository/org/apache/maven/maven-archiver/3.2.0/maven-archiver-3.2.0.jar
[ERROR] urls[8] = file:/root/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.2.0/maven-shared-utils-3.2.0.jar
[ERROR] urls[9] = file:/root/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[10] = file:/root/.m2/repository/org/codehaus/plexus/plexus-archiver/3.6.0/plexus-archiver-3.6.0.jar
[ERROR] urls[11] = file:/root/.m2/repository/org/codehaus/plexus/plexus-io/3.0.1/plexus-io-3.0.1.jar
[ERROR] urls[12] = file:/root/.m2/repository/org/apache/commons/commons-compress/1.16.1/commons-compress-1.16.1.jar
[ERROR] urls[13] = file:/root/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar
[ERROR] urls[14] = file:/root/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[15] = file:/root/.m2/repository/org/tukaani/xz/1.8/xz-1.8.jar
[ERROR] urls[16] = file:/root/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.25/plexus-interpolation-1.25.jar
[ERROR] urls[17] = file:/root/.m2/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar
[ERROR] urls[18] = file:/root/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
[ERROR] urls[19] = file:/root/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
[ERROR] urls[20] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.1.0/plexus-utils-3.1.0.jar
[ERROR] urls[21] = file:/root/.m2/repository/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.jar
[ERROR] urls[22] = file:/root/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[23] = file:/root/.m2/repository/org/apache/maven/shared/maven-mapping/3.0.0/maven-mapping-3.0.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: ExceptionInInitializerError: NullPointerException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
【追加情報】
eclipse起動コマンド実行後に下記内容ログが出ているのに気づきました。
OpenJDKのバージョンは11.0.3のはずですが、以前設定していたバージョン1.8.0_191が出てしまっておりました。
この辺りのバージョンが合っていないことが原因でしょうか?
またバージョンを11.0.3に合わせたいのですが、設定方法等ご存じでしょうか?
(調べてみましたが、具体的な設定方法を見つけることができませんでした。)
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized.
org.eclipse.m2e.logback.configuration: Logback config file: /home/adm/eclipse-workspace/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.11.0.20190220-2119.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://939.fwk1376400422:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://939.fwk1376400422:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
* BUG *
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug