Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.3:war (default-war) on project hapi-fhir-jpaserver-starter

huangapple go评论82阅读模式
英文:

Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.3:war (default-war) on project hapi-fhir-jpaserver-starter

问题

以下是您要翻译的内容:

在尝试在VPS Ubuntu服务器上使用Maven进行干净安装时,我遇到了以下错误。我已经安装了必要的项目,但仍然无济于事。

root@iHRS:~/hapi-fhir-jpaserver-starter# mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] The project ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter:war:5.1.0 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------< ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter >------------
[INFO] Building HAPI FHIR JPA Server - Starter Project 5.1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ hapi-fhir-jpaserver-starter ---
[INFO] Deleting /root/hapi-fhir-jpaserver-starter/target
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven) @ hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default-prepare-agent) @ hapi-fhir-jpaserver-starter ---
> [INFO] argLine set to
> -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/root/hapi-fhir-jpaserver-starter/target/jacoco.exec,excludes=ca/uhn/fhir/model/dstu2/**/*.class:ca/uhn/fhir/jpa/rp/r5/*.class:ca/uhn/fhir/jpa/rp/r4/*.class:ca/uhn/fhir/jpa/rp/dstu3/*.class:ca/uhn/fhir/jpa/rp/dstu2/*.class,dumponexit=true
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hapi-fhir-jpaserver-starter ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /root/hapi-fhir-jpaserver-starter/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hapi-fhir-jpaserver-starter ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/hapi-fhir-jpaserver-starter/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /root/hapi-fhir-jpaserver-starter/target/test-classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- maven-war-plugin:3.2.3:war (default-war) @ hapi-fhir-jpaserver-starter ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hapi-fhir-jpaserver-starter] in [/root/hapi-fhir-jpaserver-starter/target/hapi]
[INFO] Processing war project
[INFO] Copying webapp resources [/root/hapi-fhir-jpaserver-starter/src/main/webapp]
[INFO] Processing overlay [ id ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay]
[INFO] Webapp assembled in [990 msecs]
[INFO] Building war: /root/hapi-fhir-jpaserver-starter/target/hapi.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.3:war (default-war) on project hapi-fhir-jpaserver-starter: Error assembling WAR: Problem creating war: Execution exception: Java heap space -> [Help 1]
所以,我从昨天开始尝试设置iHRS,请帮帮我。
<details>
<summary>英文:</summary>
So I&#39;m getting this error when trying to Clean Install with Maven on a VPS Ubuntu Server.
I&#39;ve installed the necessary items to make it but still to no avail. 
root@iHRS:~/hapi-fhir-jpaserver-starter# mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING] The project ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter:war:5.1.0 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------&lt; ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter &gt;------------
[INFO] Building HAPI FHIR JPA Server - Starter Project 5.1.0
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ hapi-fhir-jpaserver-starter ---
[INFO] Deleting /root/hapi-fhir-jpaserver-starter/target
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven) @ hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default-prepare-agent) @ hapi-fhir-jpaserver-starter ---
&gt; [INFO] argLine set to
&gt; -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/root/hapi-fhir-jpaserver-starter/target/jacoco.exec,excludes=ca/uhn/fhir/model/dstu2/**/*.class:ca/uhn/fhir/jpa/rp/r5/*.class:ca/uhn/fhir/jpa/rp/r4/*.class:ca/uhn/fhir/jpa/rp/dstu3/*.class:ca/uhn/fhir/jpa/rp/dstu2/*.class,dumponexit=true
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hapi-fhir-jpaserver-starter ---
[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /root/hapi-fhir-jpaserver-starter/target/classes
[WARNING] Unable to autodetect &#39;javac&#39; path, using &#39;javac&#39; from the environment.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hapi-fhir-jpaserver-starter ---
[INFO] Using &#39;UTF-8&#39; encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /root/hapi-fhir-jpaserver-starter/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /root/hapi-fhir-jpaserver-starter/target/test-classes
[WARNING] Unable to autodetect &#39;javac&#39; path, using &#39;javac&#39; from the environment.
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) @ hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- maven-war-plugin:3.2.3:war (default-war) @ hapi-fhir-jpaserver-starter ---
[INFO] Packaging webapp
[INFO] Assembling webapp [hapi-fhir-jpaserver-starter] in [/root/hapi-fhir-jpaserver-starter/target/hapi]
[INFO] Processing war project
[INFO] Copying webapp resources [/root/hapi-fhir-jpaserver-starter/src/main/webapp]
[INFO] Processing overlay [ id ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay]
[INFO] Webapp assembled in [990 msecs]
[INFO] Building war: /root/hapi-fhir-jpaserver-starter/target/hapi.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:3.2.3:war (default-war) on project hapi-fhir-jpaserver-starter: Error assembling WAR: Problem creating war: Execution exception: Java heap space -&gt; [Help 1]
So I&#39;m trying to setup iHRS since yesterday please I need help
</details>
# 答案1
**得分**: 1
问题出在这条日志信息中(看最后一行!)
&gt; 错误组装WAR:创建WAR时出现问题:执行异常:Java堆空间
在通过 *mvn clean install* 触发构建之前,在相同的 shell/terminal 中执行以下命令:
export MAVEN_OPTS=&quot;-Xmx2048m -XX:MaxPermSize=128m&quot;
这将允许Maven在构建阶段使用更多的RAM - 最多达到2048MB。如果不起作用,您可以进一步增加此值,以查看是否构建通过。请记住,您的机器/工作站需要有足够的空闲物理RAM。否则,构建显然会再次失败。
<details>
<summary>英文:</summary>
The problem lies in this log message (see last line!)
&gt; Error assembling WAR: Problem creating war: Execution exception: Java heap space
**Before** triggering the build via *mvn clean install*, issue the following command in the same shell/terminal:
export MAVEN_OPTS=&quot;-Xmx2048m -XX:MaxPermSize=128m&quot;
It will allow Maven to use more RAM - here up to 2048 MB - during the build phase(s). If it does not work, you can increase this value even further to see if the build passes. Keep in mind that your machine/workstation has needs that amount of free, physical RAM. Otherwise, the build will obviously: fail again.
</details>

huangapple
  • 本文由 发表于 2020年9月15日 22:49:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/63904387.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定