2014-10-28 68 views
0

在構建ActiveJDBC(我是該項目的作者)時,它首先生成一個Maven插件:https://github.com/javalite/activejdbc/tree/master/activejdbc-instrumentation 插件安裝後,它用於不同的項目模塊是一個多模塊項目)。 有時生成成功,有時它與此錯誤消息打破:Maven出現間歇性問題,缺少所需的類

[INFO] JavaLite - Common .................................. SUCCESS [ 4.241 s] 
[INFO] JavaLite - Instrumentation Plugin and JavaAgent .... SUCCESS [ 2.590 s] 
[INFO] JavaLite - ActiveJDBC ORM Framework ................ FAILURE [ 5.526 s] 
[INFO] JavaLite - DB-Migrator Maven Plugin ................ SKIPPED 
[INFO] JavaLite - DB-Migrator Integration Test ............ SKIPPED 
[INFO] JavaLite - Git Info Maven plugin ................... SKIPPED 
[INFO] JavaLite - ActiveJDBC Root ......................... SKIPPED 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 12.572 s 
[INFO] Finished at: 2014-10-27T23:01:22-05:00 
[INFO] Final Memory: 26M/271M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.10-SNAPSHOT:instrument (default) on project activejdbc: Execution default of goal org.javalite:activejdbc-instrumentation:1.4.10-SNAPSHOT:instrument failed: A required class was missing while executing org.javalite:activejdbc-instrumentation:1.4.10-SNAPSHOT:instrument: javassist/ClassPath 
[ERROR] ----------------------------------------------------- 
[ERROR] realm = plugin>org.javalite:activejdbc-instrumentation:1.4.10-SNAPSHOT 
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy 
[ERROR] urls[0] = file:/home/igor/projects/javalite/activejdbc/activejdbc-instrumentation/target/activejdbc-instrumentation-1.4.10-SNAPSHOT.jar 
[ERROR] urls[1] = file:/home/igor/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar 
[ERROR] urls[2] = file:/home/igor/projects/javalite/activejdbc/activejdbc/target/classes/ 
[ERROR] urls[3] = file:/home/igor/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar 
[ERROR] urls[4] = file:/home/igor/projects/javalite/activejdbc/javalite-common/target/javalite-common-1.4.10-SNAPSHOT.jar 
[ERROR] urls[5] = file:/home/igor/projects/javalite/activejdbc/activejdbc/target/test-classes/ 
[ERROR] Number of foreign imports: 1 
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] 
[ERROR] 
[ERROR] -----------------------------------------------------: javassist.ClassPath 
[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 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 
[ERROR] mvn <goals> -rf :activejdbc 

據我所看到的,問題是: A required class was missing while executing org.javalite:activejdbc-instrumentation:1.4.10-SNAPSHOT:instrument: javassist/ClassPath

但是這個類是直接打包成的jar文件插件,請看這裏: https://oss.sonatype.org/content/repositories/snapshots/org/javalite/activejdbc/1.4.10-SNAPSHOT/

所以,構建有時工作,但有時會中斷..沒有任何代碼或配置的變化 - 在同一個終端窗口。基本上,我需要建立幾次,才能獲得成功。請幫助確定並解決問題,

我試過Maven 3.0.4和3.2.3。

感謝

+0

這是否只是做了MVN安裝後工作? – ash 2014-10-28 05:12:42

+0

我總是執行'mvn clean install',並且問題是間歇的 – ipolevoy 2014-10-28 23:00:24

+0

如果在故障發生後僅重新運行失敗的項目上的內部版本,故障是否仍然存在?如果是這樣,那麼查看本地maven回購的內容可能會提供見解。如果不是這樣,它聽起來像是一種競爭條件... – ash 2014-10-30 17:48:20

回答

1

你對在POM Javassist是一個依賴..

<dependency> 
    <groupId>javassist</groupId> 
    <artifactId>javassist</artifactId> 
    <version>3.18.2.GA</version> 
</dependency> 
+0

好吧,整個Javassist類集合直接打包到我的插件中。所有類都可以在那裏使用,所以我不包括這個依賴關係。 – ipolevoy 2014-10-28 23:01:34

+0

我不知道爲什麼maven有時候找不到它,但這似乎是問題所在。作爲maven的依賴,它使maven有能力解決這個問題。我從來沒有把課程放在包裏,因爲它似乎繞過了maven的力量。 – CharlieS 2014-10-28 23:22:53

+0

這些類被放入包中,因爲這個包被用作JavaAgent,所以它需要是自給自足的。向Maven添加一個依賴關係似乎是多餘的,但我會嘗試這樣做。 – ipolevoy 2014-10-30 03:39:50