ฉันมีโครงการ gradle ที่มีการพึ่งพาดังต่อไปนี้:
compile "commons-codec:commons-codec:+"
compile "commons-io:commons-io:+"
compile "org.apache.poi:poi:+"
compile "commons-logging:commons-logging:+"
compile "net.sourceforge.cssparser:cssparser:+"
compile "net.sourceforge.htmlunit:htmlunit:+"
compile "net.sourceforge.htmlunit:htmlunit-core-js:+"
compile "net.sourceforge.htmlunit:neko-htmlunit:+"
compile "org.apache.commons:commons-lang3:+"
compile "org.apache.httpcomponents:httpclient:+"
compile "org.apache.httpcomponents:httpmime:+"
compile "org.eclipse.jetty.websocket:websocket-client:+"
compile "xalan:xalan:+"
compile "org.apache.poi:poi:+"
compile "org.apache.poi:poi-ooxml:+"
compile "org.apache.cassandra:cassandra-all:+"
compile "org.apache.cassandra:cassandra-thrift:+"
compile "com.whalin:Memcached-Java-Client:+"
compile "org.hibernate:hibernate-gradle-plugin:+"
compile "org.hibernate:hibernate-core:+"
compile "org.hibernate:hibernate-tools:+"
compile "org.hibernate:hibernate-entitymanager:+"
compile "org.hibernate:hibernate:+"
compile "org.hibernate:hibernate-annotations:+"
compile "mysql:mysql-connector-java:+"
compile "org.hibernate:ejb3-persistence:+"
compile "javax:javaee-api:+"
compile "javax.persistence:persistence-api:+"
compile "javassist:javassist:+"
ฉันไม่สามารถรันในโหมดแก้ไขข้อบกพร่องโดยใช้ NetBeans IDE ได้ เมื่อฉันลอง ฉันได้รับข้อยกเว้นดังต่อไปนี้:
18:54:28.174 [main] DEBUG o.h.cfg.annotations.PropertyBinder - Building property year_end
Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:1106)
ทำไม
คำถามของฉันไม่ซ้ำใครเพราะไม่เกี่ยวกับการรวบรวม โปรแกรมของฉันคอมไพล์ได้ดีด้วยโค้ด (gradle) ต่อไปนี้:
task compileJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Applic version 0.9',
'Implementation-Version': version,
'Main-Class': 'com.company.runfile'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
สิ่งนี้จะสร้างไฟล์ jar ที่ทำงานอย่างถูกต้อง แต่ฉันไม่สามารถดีบักแอปพลิเคชันเดียวกันใน NetBeans (เช่นใน Intellij IDEA) ได้