我想在Ubuntu 12.04上使用NetBeans运行我的gradle Java EE项目。 错误 - 项目输出:
Build failure: gradle run
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'
我的gradle -version输出:
------------------------------------------------------------
Gradle 1.7
------------------------------------------------------------
Build time: 2013-08-06 11:19:56 UTC
Build number: none
Revision: 9a7199efaf72c620b33f9767874f0ebced135d83
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.6.0_27 (Sun Microsystems Inc. 20.0-b12)
OS: Linux 3.2.0-52-generic-pae i386
和我的build.gradle文件:
apply plugin: 'java'
apply plugin: 'war'
mainClass = "main.Main"
sourceCompatibility = '1.7'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (!hasProperty('mainClass')) {
ext.mainClass = 'main.Main'
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '3.6.7.Final'
compile "javax.ws.rs:jsr311-api:1.1.1"
compile 'com.sun.jersey:jersey-server:1.13'
compile 'com.sun.jersey:jersey-core:1.13'
compile 'com.sun.jersey:jersey-servlet:1.13'
testCompile group: 'junit', name: 'junit', version: '4.10'
}
当我尝试使用Hibernate(创建EntityManager)时会发生此错误: NetBeans日志:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named WebSISMSPUpgsql
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at jpa.EntityManagerFactory.reinit(EntityManagerFactory.java:69)
at jpa.EntityManagerFactory.<init>(EntityManagerFactory.java:61)
at jpa.EntityManagerFactory.<init>(EntityManagerFactory.java:56)
at jpa.EntityManagerFactory.getInstance(EntityManagerFactory.java:43)
at main.Main.main(Main.java:18)
:run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/usr/lib/jvm/jdk1.7.0_25/bin/java'' finished with non-zero exit value 1
我该怎么办呢?