Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runShadow doesn't execute shadowJar #340

Open
THUFIR opened this issue Nov 13, 2017 · 5 comments
Open

runShadow doesn't execute shadowJar #340

THUFIR opened this issue Nov 13, 2017 · 5 comments

Comments

@THUFIR
Copy link

THUFIR commented Nov 13, 2017

Please check the (User Guide)[http://imperceptiblethoughts.com/shadow] before submitting "how do I do 'x'?" questions!

Shadow Version

2.0.1

Gradle Version

4.3.1

Expected Behavior

runShadow will execute the uber jar

Actual Behavior

runShadow crashes

Gradle Build Script(s)

plugins {
id 'com.gradle.build-scan' version '1.8'
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '2.0.1'
}

buildScan {
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
licenseAgree = 'yes'
// publishAlways()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

mainClassName = 'net.bounceme.dur.gradle.hello.App'

shadowJar {
baseName = 'greeter'
classifier = null
version = null
}

repositories {
jcenter()
}

configurations {
provided
}

dependencies {
}

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

META-INF/
META-INF/MANIFEST.MF
net/
net/bounceme/
net/bounceme/dur/
net/bounceme/dur/gradle/
net/bounceme/dur/gradle/hello/
net/bounceme/dur/gradle/hello/App.class

see also:

https://stackoverflow.com/q/47261691/262852

perhaps it's not a bug...but maybe it is.

@THUFIR
Copy link
Author

THUFIR commented Nov 13, 2017

here's a clearer demonstration:


thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ sdk use gradle 4.3.1

Using gradle version 4.3.1 in this shell.
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ gradle clean runShadow

> Task :shadowJar 
A problem was found with the configuration of task ':shadowJar'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
 - No value has been specified for property 'mainClassName'.
The SimpleWorkResult type has been deprecated and is scheduled to be removed in Gradle 5.0. Please use WorkResults.didWork() instead.

> Task :startShadowScripts 
Using TaskInputs.file() with something that doesn't resolve to a File object has been deprecated and is scheduled to be removed in Gradle 5.0. Use TaskInputs.files() instead.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installShadowDist'.
> The specified installation directory '/home/thufir/NetBeansProjects/gradleHelloWorld/build/install/gradleHelloWorld-shadow' is neither empty nor does it contain an installation for 'gradleHelloWorld'.
  If you really want to install to this directory, delete it and run the install task again.
  Alternatively, choose a different installation directory.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
5 actionable tasks: 5 executed
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ sdk use gradle 4.2.1

Using gradle version 4.2.1 in this shell.
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ gradle clean runShadow
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :shadowJar
The SimpleWorkResult type has been deprecated and is scheduled to be removed in Gradle 5.0. Please use WorkResults.didWork() instead.

> Task :runShadow
Nov 13, 2017 12:02:51 PM net.bounceme.dur.gradle.hello.App run
INFO: helloooo


BUILD SUCCESSFUL in 12s
6 actionable tasks: 6 executed
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ javac -version
javac 1.8.0_151
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ sdk ls java

================================================================================
Available Java Versions
================================================================================
     9.0.1-oracle                                                                  
   * 9.0.0-zulu                                                                    
     8u152-zulu                                                                    
 > * 8u151-oracle                                                                  
     8u144-zulu                                                                    
     8u131-zulu                                                                    
     7u141-zulu                                                                    
     6u93-zulu                                                                     
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   

================================================================================
+ - local version
* - installed
> - currently in use
================================================================================
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"
thufir@dur:~/NetBeansProjects/gradleHelloWorld$ 

@THUFIR
Copy link
Author

THUFIR commented Nov 13, 2017

possible duplicate of

#339

@johnrengelman
Copy link
Collaborator

@THUFIR have you tried this with 2.0.2 yet?

@THUFIR
Copy link
Author

THUFIR commented Feb 7, 2018

@johnrengelman not as of yet, pardon. will keep you posted.

@kristus123
Copy link

Can this be closed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants