WildFly Swarm + War + local Jar dependencies in Gradle - NullPointerException - java

I am trying to build a web application server using WildFly Swarm and the application has to be able to run another Java program inside (I don't want to run it as an external process). I am trying to include the external program as .jar dependency to my web application, however, wildfly-swarm-package task always fails with the following:
:clean
:compileJava
:processResources UP-TO-DATE
:classes
:war
:wildfly-swarm-package FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':wildfly-swarm-package'.
> java.lang.NullPointerException (no error message)
This is my gradle.build file:
buildscript {
version = System.getProperty('swarmVersion') ?: '2016.10.0'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.5.6.RELEASE"
classpath "org.wildfly.swarm:wildfly-swarm-plugin:$version"
}
}
apply plugin: "io.spring.dependency-management"
apply plugin: 'wildfly-swarm'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'war'
//mainClassName = 'org.siret.prank.webapp.rest.Main'
swarm {
properties {
swarm.http.port = 8181
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://maven.repository.redhat.com/nexus/content/repositories/releases/'
}
maven {
url 'https://maven.repository.redhat.com/nexus/content/repositories/thirdparty-releases/'
}
flatDir {
dirs 'libs'
}
}
dependencyManagement {
imports {
mavenBom "org.wildfly.swarm:bom-all:$version"
}
}
dependencies {
compile group: 'org.biojava', name: 'biojava-core', version: '4.2.4'
compile group: 'org.biojava', name: 'biojava-structure', version: '4.2.4'
compile "org.wildfly.swarm:jaxrs"
compile group: 'org.wildfly.swarm', name: 'undertow', version: '2016.10.0'
compile 'org.codehaus.groovy:groovy-all:2.4.7'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: 'libs/lib', include: ['*.jar'])
}
task debugJar(dependsOn:"wildfly-swarm-package") << {
javaexec {
main="-jar";
args=[
"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006",
"build/libs/prank-webapp-swarm.jar"
]
}
}
task runJar(dependsOn:"wildfly-swarm-package") << {
javaexec {
main="-jar";
args=[
"build/libs/prank-webapp-swarm.jar"
]
}
}
War plugin works fine, I can find the jars in WEB-INF/lib directory in the archive.
As an experiment, I tried to empty the libs folder and the error still persists.
Thanks,
Lukas

I migrated to Maven to find out that importing jar to local maven repository is the answer to the problem.
Now, both Maven an Gradle work.

Related

How to include local jars into a fat jar using Gradle 6.3?

On a Linux machine running Java 8 and Gradle 6.3 I need to build a fat jar made of mix of libraries, some sourced from Maven Central, others from a local libs directory located at the root of my repository, together with my build.gradle and the gradlew:
apply plugin: 'java'
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
task copyLibs(type: Copy) {
from configurations.compile
into 'libs'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation "junit:junit:4.12"
}
After running ./gradlew clean build and cd build/libs, if I unzip myproject.jar I can see that no dependencies have been included in the jar.
My end goal is to make my project executable as java -jar myproject.jar.
How can I solve this?
After unzipping your jar file check here for all dependencies.
Your-Project --> BOOT-INF --> libs
by default, if your Gradle build is successful the jar files come here.
you can run java -jar then.
This is a build.gradle that generates a fat jar including local dependencies:
plugins {
id 'java'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group 'com.mycompany.foo'
version '1.0'
jar {
archiveBaseName = 'myjarname'
archiveVersion = '0.1.0'
manifest {
attributes(
'Main-Class': 'com.mycompany.foo.Main'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
repositories {
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation'org.junit.jupiter:junit-jupiter-api:5.7.2'
testImplementation 'org.assertj:assertj-core:3.20.2'
}

How to exclude dependencies from BOOT-INF/classes?

I have a spring boot project and I get this error when I try to build it:
> gradle build
:processResources
:compileJava
:classes
:jar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jar'.
> archive contains more than 65535 entries.
To build this archive, please enable the zip64 extension.
See: https://docs.gradle.org/3.5.1/dsl/org.gradle.api.tasks.bundling.Zip.html#org.gradle.api.tasks.bundling.Zip:zip64
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ok, I added the zip64 = true option to the jar task in the gradle configuration.
Now it can build the jar successfully but when I try to execute the jar, I get the following exception:
Exception in thread "main" java.lang.IllegalStateException: java.lang.IndexOutOfBoundsException
at org.springframework.boot.loader.ExecutableArchiveLauncher.<init>(ExecutableArchiveLauncher.java:43)
at org.springframework.boot.loader.JarLauncher.<init>(JarLauncher.java:37)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.IndexOutOfBoundsException
at org.springframework.boot.loader.jar.AsciiBytes.<init>(AsciiBytes.java:69)
at org.springframework.boot.loader.jar.CentralDirectoryFileHeader.load(CentralDirectoryFileHeader.java:95)
at org.springframework.boot.loader.jar.CentralDirectoryParser.parseEntries(CentralDirectoryParser.java:68)
at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:57)
at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:118)
at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:106)
at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:92)
at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:83)
at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:61)
at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57)
at org.springframework.boot.loader.Launcher.createArchive(Launcher.java:129)
at org.springframework.boot.loader.ExecutableArchiveLauncher.<init>(ExecutableArchiveLauncher.java:40)
... 2 more
It turned out that SpringBoot doesn't even support the zip64 format, so I had to make further investigation.
Where do the 65535+ entries come from? Obviously these come from dependencies, because the issue exists since
I added a new dependency in the build.gradle file. While examining the zip64 jar, I have found that
all the dependency classes! are under the BOOT-INF/classes folder.
As I understand, the structure must look like
BOOT-INF/
classes/
<only this application's compiled classes>
libs/
<all the dependency jars>
But my classes folder has all the dependency jars "extracted" to it.
(As you can see)
I extracted the jar, removed all the dependency classes from this folder and rezipped it. (Like this)
This way it can be run without any problem, so I'm sure these files are unneccesary.
Can somebody help me, how to exclude these dependency classes from the structure? Thank you in advance!
Here's my relevant gradle configuration:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'org.springframework.boot'
ext.springBootVersion = '1.4.2.RELEASE'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
}
}
configurations {
provided.all*.exclude group: 'javax.servlet'
}
mainClassName = 'com.path.to.my.MainClass'
repositories {
mavenCentral()
maven {
url "https://repository.jboss.org/nexus/content/repositories/releases"
}
maven {
url "https://repo.eclipse.org/content/groups/releases/"
}
}
jar {
//zip64 = true
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes("Main-Class": mainClassName)
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile 'aopalliance:aopalliance:1.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.gdata:core:1.47.1'
compile 'com.google.guava:guava:19.0'
compile 'commons-io:commons-io:2.4'
compile 'javax.json:javax.json-api:1.0'
compile 'mysql:mysql-connector-java:5.1.22'
compile 'org.apache.commons:commons-csv:1.4'
compile 'org.flywaydb:flyway-core:4.0.3'
compile 'org.glassfish:javax.json:1.0.4'
......
testCompile 'org.springframework.boot:spring-boot-starter-test'
}
bootRun {
addResources = true
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}

Gradle fail to download Kotlin repository

I'm building Kotlin simple Hello-Worl using Gradle
my build.gradle is:
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a commented-out sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.3.1/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Kotlin
apply plugin: 'kotlin'
/*
plugins {
id "org.jetbrains.kotlin.jvm" version "1.1.60"
}
*/
buildscript {
ext.kotlin_version = '1.1.60'
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
// jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
sourceSets {
main.kotlin.srcDirs += 'src/kotlin'
main.resources.srcDirs += 'src/resources'
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile 'junit:junit:4.12'
}
kotlin {
experimental {
coroutines 'enable'
}
}
compileKotlin {
kotlinOptions.suppressWarnings = true
}
compileKotlin {
kotlinOptions {
suppressWarnings = true
}
}
and Main.kt is:
fun main(args: Array<String>) {
println("kotlin!")
}
upon running Gradle buil, I got the below error:
Notes:
- I'm new to gradle so built it as below 2 steps:
Step 1:
Step 2:
UPDATE
As per the first answer, I tried getting the files locally, I created another folder named lib and downloaded the *.jar files into it, so I got the gradle.build as below:
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
classpath fileTree(include: ['*.jar'], dir: 'libs')
classpath files('kotlin-gradle-plugin-1.1.60.jar')
}
}
apply plugin: 'kotlin'
sourceSets {
main.kotlin.srcDirs += 'src/kotlin'
main.resources.srcDirs += 'src/resources'
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile name: 'kotlin-stdlib-1.1.60'
testCompile 'junit:junit:4.12'
}
kotlin {
experimental {
coroutines 'enable'
}
}
compileKotlin {
kotlinOptions.suppressWarnings = true
}
compileKotlin {
kotlinOptions {
suppressWarnings = true
}
}
Below the revised structure and new error I got:
UPDATE
U copied all the required repositories .jar and .pom to folder:
C:\Users\.m2\repository\org\jetbrains\
I copied for example:
...\kotlin\kotlin-std\1.1.60\kotlin-stdlib-1.1.60.jar
And
...\annotations\13.0\annotations-13.0.jar
And used
mavenLocal()
But still getting the same error :(
I found the issue to be with our company proxy that prevented such thing, so I solved the issue by downloading the required repository in my hole laptop then copied them to the company one.
First, I created a separate folder, named it jars.
After that I downloaded the required file from here and saved it in the jars folder.
Then I installed it into the local repository using the command:
mvn install:install-file -Dfile=utility.jar -DgroupId=com.company -DartifactId=utility -Dversion=0.0.1 -Dpackaging=jar
Such as:
mvn install:install-file -Dfile=kotlin-stdlib-1.1.60.jar -DgroupId=org.jetbrains.kotlin -DartifactId=kotlin-stdlib -Dversion=1.1.60 -Dpackaging=jar
Notes:
To do the above correctly, the maven is required to be downloaded from here and added to the path.
And command above is required to be run from the jars folder, that contains the downloaded repository:
Then I found that the repository had been downloaded into C:\Users\<user>\.m2\ folder:
After copying them into my office laptop, I called them from the mavenLocal():
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile ("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
}
UPDATE
To download the full repository in one shoot instead of downloading the required files one by one, then the following command can be used:
mvn dependency:get -DrepoUrl=something -Dartifact=group:artifact:version
Such as:
mvn dependency:get -DrepoUrl=https://mvnrepository.com/artifact/org.jetbrains.kotlin -Dartifact=org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.60
For some reason 3 files failed to be downloaded, so I got them downloaded manually and installed as per the initial explanation,the files are:
org.jetbrains.kotlin:kotlin-android-extensions:jar:original:1.1.60 => here
org.jetbrains.kotlin:kotlin-compiler-runner:jar:original:1.1.60 => here
org.jetbrains.kotlin:kotlin-build-common:jar:tests:1.1.60 => here
and got them installed using the below commands:
mvn install:install-file -Dfile=kotlin-android-extensions-1.1.60.jar -DgroupId=org.jetbrains.kotlin -DartifactId=kotlin-android-extensions -Dversion=1.1.60 -Dpackaging=jar
mvn install:install-file -Dfile=kotlin-compiler-runner-1.1.60.jar -DgroupId=org.jetbrains.kotlin -DartifactId=kotlin-compiler-runner -Dversion=1.1.60 -Dpackaging=jar
mvn install:install-file -Dfile=kotlin-build-common-1.1.60.jar -DgroupId=org.jetbrains.kotlin -DartifactId=kotlin-build-common -Dversion=1.1.60 -Dpackaging=jar
Considering all the above done, the below build.gradle worked perfectly for me:
// set up the kotlin-gradle plugin
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
mavenLocal() // mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
// apply the kotlin-gradle plugin
apply plugin: "kotlin"
// add kotlin-stdlib dependencies.
repositories {
mavenLocal() // mavenCentral()
}
dependencies {
//dependencies from a remote repositor
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
//local file, that are not coming from repository, let's say my own jar files
compile files('libs/Display.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}
jar {
manifest {
//Define mainClassName as: '[your_namespace].[your_arctifact]Kt'
attributes ('Main-Class': 'MainKt', "Implementation-Title": "Gradle",
"Implementation-Version": 1)
}
// NEW LINE HERE !!!
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
sourceSets {
main.kotlin.srcDirs += 'src/kotlin'
main.resources.srcDirs += 'src/resources'
}
kotlin {
experimental.coroutines 'enable'
}
compileKotlin {
kotlinOptions.jvmTarget= 1.8 // optional, Minimum jvmTarget of 1.8 needed since Kotlin 1.1
kotlinOptions.suppressWarnings = true
}

Gradle not able to detect osdetector plugin

I am using OpenSSL for my Java GRPC project which uses gradle.
I read the documetation which mentions that we should make security settings as mentioned in this link.
I have included the osdetector plugin in the build.gradle file.
But when I build the project, gradle is not able to resolve the osdetector plugin and throwing error
> Failed to apply plugin [id 'com.google.protobuf']
> Plugin with id 'osdetector' not found.
My gradle file is as follows:
def neo4jVersion = "2.3.3"
apply plugin: 'application'
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
apply plugin: 'com.google.osdetector'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.3'
classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0'
}
}
protobuf {
protoc {
// The version of protoc must match protobuf-java. If you don't depend on
// protobuf-java directly, you will be transitively depending on the
// protobuf-java version that grpc depends on.
artifact = "com.google.protobuf:protoc:3.0.0-beta-2"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:0.12.0'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
generatedFilesBaseDir = "$projectDir/src/generated"
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'io.grpc:grpc-all:0.12.0'
compile "org.neo4j:neo4j:${neo4jVersion}"
compile "org.neo4j:neo4j-ogm-core:2.0.1"
compile "org.neo4j:neo4j-ogm-http-driver:2.0.1"
compile 'com.google.apis:google-api-services-storage:v1-rev71-1.22.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
compile 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork14:' + osdetector.classifier
}
The compile dependency alone is getting resolved however.
I think I am missing something basic here. Please let me know the solution.
Updated
protobuf-gradle-plugin is not compatible with osdetector-gradle-plugin-1.4.0, since that version changed the name of the plugin. Swapping to version osdetector 1.2.1 should fix the problem.

Gradle error while setting up LibGDX with eclipse

I am trying to setup a libGdx with eclipse using this tutorial
but when I try to build the project I got this error
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'TestGame'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve de.richsource.gradle.plugins:gwt-gradle-plugin:0.5.
Required by:
:TestGame:unspecified
> Could not GET 'https://repo1.maven.org/maven2/de/richsource/gradle/plugins/gwt-gradle-plugin
/0.5/gwt-gradle-plugin-0.5.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/de/richsource/gradle/plugins/gwt-gradle-plugin/0.
5/gwt-gradle-plugin-0.5.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not resolve com.android.tools.build:gradle:0.13+.
Required by:
:TestGame:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/buil
d/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-met
adata.xml'.
> Connection to https://repo1.maven.org refused
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/tools/build/g
radle/maven-metadata.xml.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metada
ta.xml'.
> Connection to https://jcenter.bintray.com refused
> Could not resolve org.robovm:robovm-gradle-plugin:1.0.0-alpha-04.
Required by:
:TestGame:unspecified
> Could not GET 'https://repo1.maven.org/maven2/org/robovm/robovm-gradle-plugin/1.0.0-alpha-04
/robovm-gradle-plugin-1.0.0-alpha-04.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/org/robovm/robovm-gradle-plugin/1.0.0-alpha-04/ro
bovm-gradle-plugin-1.0.0-alpha-04.pom'.
> Connection to https://jcenter.bintray.com refused
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l
og output.
BUILD FAILED
Total time: 2 mins 12.602 secs
And the libGDX ui generated this build gradle file
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.5'
classpath 'com.android.tools.build:gradle:0.13+'
classpath 'org.robovm:robovm-gradle-plugin:1.0.0-alpha-04'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = 'TestingGame'
gdxVersion = '1.4.1'
roboVMVersion = '1.0.0-alpha-04'
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
compile "com.badlogicgames.box2dlights:box2dlights:1.2"
}
}
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
configurations { natives }
dependencies {
compile project(":core")
compile "org.robovm:robovm-rt:${roboVMVersion}"
compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
}
}
project(":html") {
apply plugin: "gwt"
apply plugin: "war"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
compile "com.badlogicgames.box2dlights:box2dlights:1.2:sources"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.box2dlights:box2dlights:1.2"
}
}
tasks.eclipse.doLast {
delete ".project"
}
I Know Maven but I don't know gradle so I can't understand the exception and where I've gone wrong even I did everything in the tutorial, any help please?
After a lot of searching i found that i need to add the GWT that i downloaded to the eclipse plugin and that was not mentioned in the tutorial
so what i did is
in eclipse go to WINDOWS --->PREFERENCE--->GOOGLE ---->WEB TOOLKIT --->add and search for the folder you have extracted its ZIP file
I had a similar problem with Gradle (Could not GET 'https...) but with a different project. I'm behind a firewall as well
I tried using a separate gradle.properties and also tried passing the proxy server/port to gradle via the VM arguments as mentioned by some other posts on SO but neither of those worked
Here's a way I found via Eclipse settings that worked for me
Under Window->Preferences->Network Connections set the Active Provider to Manual
.
Then edit the entries for HTTP and HTTPS and add the proxy server and port there. If your proxy needs your credentials make sure you add those there as well. Try building it again and hopefully it works this time

Categories