gpt4 book ai didi

Maven Surefire 插件丢失?

转载 作者:行者123 更新时间:2023-12-02 20:47:44 25 4
gpt4 key购买 nike

所以我遇到了问题,我正在按照教程 Working with Custom Content types in Alfresco 进行操作但当我尝试安装该程序时遇到 Maven 问题。它告诉我 Maven Surefire 插件存在问题,如下所示:

    C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo>mvn install
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building content-tutorial-repo Repository AMP project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://artifacts.alfresco.com/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
Downloading: https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
Downloading: http://oss.sonatype.org/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/maven-metadata.xml
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-sdk-requirements) @ content-tutorial-repo ---
[INFO]
[INFO] --- alfresco-maven-plugin:2.2.0:set-version (default-set-version) @ content-tutorial-repo ---
[INFO] Removed -SNAPSHOT suffix from version - 1.0
[INFO] Added timestamp to version - 1.0.1704260956
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:add-test-resource (add-env-test-properties) @ content-tutorial-repo ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ content-tutorial-repo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo\src\main\resources
[INFO] Copying 17 resources to C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo\target/amp
[INFO]
[INFO] --- alfresco-maven-plugin:2.2.0:refresh (refresh-webscripts-repo-and-share) @ content-tutorial-repo ---
[WARNING] Connection failed to localhost:8080, null webapp refresh aborted
[INFO]
[INFO] --- maven-compiler-plugin:3.5:compile (default-compile) @ content-tutorial-repo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ content-tutorial-repo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (add-module-properties-to-test-classpath) @ content-tutorial-repo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to alfresco/module/content-tutorial-repo
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (add-module-config-to-test-classpath) @ content-tutorial-repo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5:testCompile (default-testCompile) @ content-tutorial-repo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ content-tutorial-repo ---

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Error occurred during initialization of VM
Could not reserve enough space for 1560576KB object heap
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.226 s
[INFO] Finished at: 2017-04-26T09:56:10+02:00
[INFO] Final Memory: 18M/44M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project content-tutorial-repo: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files (x86)\Java\jdk1.8.0_121\jre\bin\java" -Xms256m -Xmx1524m -XX:MaxPermSize=256m -Duser.language=en -jar C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo\target\surefire\surefirebooter6817806541714880563.jar C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo\target\surefire\surefire2049933145142894733tmp C:\Users\admin\Desktop\tutorial_home\content-tutorial-repo\target\surefire\surefire_03570301801919192406tmp"
[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/PluginExecutionException

问题是我没有这样的directory in my project正如您在 中看到的。那么我在哪里可以找到它或使用 maven 生成它?

感谢您的帮助!

最佳答案

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Error occurred during initialization of VM
Could not reserve enough space for 1560576KB object heap

这是问题的根源:在尝试进行测试时,surefire 插件尝试实例化 JVM 但失败,因为它无法分配足够的内存。缺少 target\surefire 目录只是该故障的结果,target 目录在故障后被清理。

您应该按照优先顺序尝试:

  • 为运行测试的 JVM 提供更多可用内存。这可以通过 increasing your available swap memory 解决例如

  • 限制测试 JVM 使用的内存。看一下surefire插件配置,可以设置JVM parameters

  • 要跳过所有测试:使用 mvn install -DskipTests ;当然,执行过程不再一样了

关于Maven Surefire 插件丢失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43628932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com