[英]How to use Gradle to generate Eclipse and Intellij project files for Android projects
[英]How do you integrate gradle and jboss 6 to generate working eclipse projects
情況
我想集成gradle腳本以指定JBoss AS 6的依賴項,並使用該腳本創建eclipse項目。 我們目前正在使用gradle進行項目。 它構建良好,並且可以正確運行測試,但是當我們嘗試將其導入eclipse時,會出現錯誤。 我們有一個名為jbossHome的屬性變量。 我將所有庫都轉儲到jboss6的一個目錄中,這就是jbossHome指向的目錄。
repositories{
fileTree(dir: jbossHome) //include required JBoss jars
}
dependencies {
providedCompile fileTree(dir: jbossHome) // include the required JBoss jars
}
問題
導入Eclipse時,出現以下錯誤:
我們同時需要一個Web服務項目和一個jms項目。
問題#1-如何設置我的項目以使用Maven存儲庫並包含/排除類似於此jboss 7示例的正確jars?
問題2-如果使用Maven倉庫,是否可以指定它以將其緩存到特定目錄,這樣它就不會每次都下載以集成到Jenkins這樣的CI服務器中?
注意:我一直在研究項目和語言,並且對Gradle或Maven不太熟悉。 我對CMake非常熟悉,但是AFAIK沒有類似的概念與依賴項和Maven倉庫。
以下gradle為我工作。 我還嘗試通過war進行部署,因此我需要確保使用provideCompile而不是進行編譯,否則每個jboss .jar文件都會最終出現在war文件中。
repositories {
mavenCentral()
mavenRepo urls: "http://repository.jboss.org/nexus/content/groups/public"
}
dependencies {
//*****Note - providedCompile means to use it during compile, but don't include the war
//jboss and hornetq
providedCompile ("org.jboss.jbossas:jboss-as-client:6.0.0.Final") {
exclude group: 'org.hibernate', module: 'hibernate-annotations' //error if not excluded
exclude group: 'com.sun.istack', module: 'istack-commons-runtime' //error if not excluded
}
providedCompile ("org.hornetq:hornetq-jms:2.1.2.Final")
}
我希望這可以幫助其他人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.