2017-04-26 187 views
0

所以我有一個問題,我正在按照教程Working with Custom Content types in Alfresco,但當我嘗試安裝該程序時,我遇到了一個maven問題。它告訴我有一個關於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生成它?

Tahnk你的幫助!

+0

'無法爲1560576KB對象堆預留足夠的空間'是您應該從此日誌中保留的內容。我看不到你的截圖(* .imgur.com對我來說是封鎖的),但是如果你正在談論'target \ surefire \'目錄,它必須在失敗後被移除 – Aaron

+0

是的我正在談論「target \ surefire」目錄。 – JackA

+0

由於構建失敗,所以'target'目錄必須已經清理完畢,這樣你就不會認爲你已經準備好了實際的包。無論如何,你必須修復堆分配失敗(或者你可以跳過surefire測試,以避免問題) – Aaron

回答

1

好了,我解決我的問題這些行添加到我的pom.xml

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <configuration> 
       <argLine>-Xmx512m</argLine> 
       <forkMode>pertest</forkMode> 
       <childDelegation>true</childDelegation> 
       <testFailureIgnore>true</testFailureIgnore> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

的Merci安可@Aaron

編輯:如果如果您沒有,則可能需要在x64中安裝JDK所需的那些內存類型的問題。這應該不僅僅是解決這個問題。

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

這是你的問題的根源:嘗試做測試,神火插件試圖實例化一個JVM,但因爲它無法分配足夠的內存失敗。 target\surefire目錄的缺失只是由於該故障導致的,target目錄在故障後被清除。

你應該嘗試,在優先順序:

  • 具有可用於將運行測試的JVM的內存。這可以通過increasing your available swap memory來解決,例如

  • 來限制測試JVM使用的內存。看看surefire插件的配置,你可以設置JVM parameters

  • 跳過所有的測試:使用mvn install -DskipTests;當然,執行不一樣了

相關問題