0

I created a script in gradle. When I select Run -> External Tools -> External Tools Configurations -> Gradle build for Creating new build and its throwing error An error has occurred.

"See error log for more details.!java.lang.NullPointerException " its displayed in messagebox

After editing build.gradle file same error also displaying! "An internal error occurred during: "Calculating Gradle Tasks...".java.lang.NullPointerException"

apply plugin: 'java'
apply plugin: 'eclipse'
version = "1.0"
sourceCompatibility = 1.7
jar {
manifest {
    attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': 
   version    
}
 }
 buildscript {
repositories {
    mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:0.4.+'
}
   }

   repositories {   
mavenCentral()  
   }
   sourceSets {
  unitTest {
      java.srcDir file('src/test/java')
      resources.srcDir file('src/test/resources')
  }
   }
 task wrapper(type: Wrapper) {
  description = 'Install Gradle wrapper'
  gradleVersion = '1.10'
}
    dependencies {

compile 'org.apache.poi:poi:3.9'
compile 'org.testng:testng:6.8.5'
compile 'org.seleniumhq.selenium:selenium-server:2.39.0'
compile 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.42.2'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'net.sf.json-lib:json-lib:2.4:jdk15'
compile 'log4j:log4j:1.2.17'
    }

     test {
     useTestNG(){  
    options.suites("src/test/resources/testng.xml")
     }
      }

      uploadArchives {
repositories {
   flatDir {
       dirs 'repos'
   }
}
    }

Anything i missed in configuration, anyone can help me?

saravanakumar
  • 49
  • 3
  • 8

1 Answers1

1

I have created a Gradle project in Eclipse, and pasted your build.gradle contents into mine. Your gradle script seems fine to me. I could: - See Gradle tasks for the project in Gradle Tasks view - Open Gradle Build launcher configuration wizard via context menu on the project explorer and via the Run External Tools - Could launch Gradle tasks All that with STS 3.6.0 M1 (latest Gradle Eclipse integration

Which STS are you using? Or which version of Gradle Eclipse integration? What's the stack trace for the NPE? Try upgrading your Gradle eclipse integration from this update site: http://dist.springsource.com/release/TOOLS/gradle If that still won't work try the latest, STS 3.6.0 RC1 update site and pick Gradle Eclipse Integration from there http://dist.springsource.com/milestone/TOOLS/update/3.6.0.RC1/e4.4 (replace e4.4 with your eclipse version, e.g. e4.3, e4.2, e3.8, e3.7)

aboyko
  • 1,337
  • 1
  • 9
  • 11
  • Aboyko, Thanks for your suggestion. Let me try and let u know – saravanakumar Jun 18 '14 at 04:58
  • We are getting this error with 3.6.0 milestone ...533M1 and Luna (e4.4) the path we use for the plugin is milestone/TOOLS/gradle is there any way to get a later version as it always crashes with external tools. – Theresa Forster Jan 21 '15 at 08:46
  • Try the nightly build: http://dist.springsource.com/snapshot/TOOLS/gradle/nightly the "External Tools" launch config should be fixed there. – aboyko Jan 21 '15 at 17:53