2015-01-20 99 views
1

工作我完全陌生的搖籃,因此它可能是一個明顯的問題:args4J不gradle這個

我使用日食與gradle這個,我實際上是沒有問題增加了對JUnit的或東西的依賴性,它將junit lib添加到gradle依賴項中,並且使用junit沒有問題,但是如果我嘗試使用args4j(還會添加依賴項),它就不起作用。

只是爲了確保有一個與該的build.gradle

apply plugin: 'java' 
apply plugin: 'eclipse' 

sourceCompatibility = 1.8 
version = '1.0' 
jar { 
    manifest { 
     attributes 'Implementation-Title': 'title', 
     'Implementation-Version': version, 
     'Main-Class':'path.to.main.Main' 
    } 
} 

repositories { 
    mavenCentral() 
} 

test { 
    systemProperties 'property': 'value' 
} 

dependencies{ 
    compile 'args4j:args4j-site:2.0.25' 
    testCompile group: 'junit', name: 'junit', version: '4.+' 
} 

沒有問題,不,我沒有使用標題或path.to.main ^^

的Eclipse讓我發現,進口( args4j)無法解析

回答

2

你忘記主「args4j」模塊:

compile group: 'args4j',    name: 'args4j',  version: '2.0.25' 
compile group: 'args4j',    name: 'args4j-site', version: '2.0.25' 
+0

哦,夥計......謝謝你,它˚F最近的作品:D 我嘗試了同樣的方式,但名稱爲args4j-網站^^ – 2015-01-20 21:18:48

+0

好吧,我只注意到http://mvnrepository.com/artifact/args4j/args4j-site/2.0.25不起作用方式^^如果我刪除「-site」它的作品,但非常感謝 – 2015-01-20 21:54:04