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

layertools with a wrong option seems to fail silently #22042

Closed
izeye opened this issue Jun 21, 2020 · 2 comments
Closed

layertools with a wrong option seems to fail silently #22042

izeye opened this issue Jun 21, 2020 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@izeye
Copy link
Contributor

izeye commented Jun 21, 2020

layertools with a wrong option seems to fail silently.

If I use a correct option with this sample, it succeeds as follows:

$ ./gradlew clean bootJar

BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed
$ java -Djarmode=layertools -jar build/libs/spring-boot-throwaway-branches-1.0.jar extract --destination build/temp
$ ls -al build/temp/
total 0
drwxr-xr-x  6 user  staff  192 Jun 21 11:29 .
drwxr-xr-x  8 user  staff  256 Jun 21 11:29 ..
drwxr-xr-x  4 user  staff  128 Jun 21 11:29 application
drwxr-xr-x  3 user  staff   96 Jun 21 11:29 dependencies
drwxr-xr-x  2 user  staff   64 Jun 21 11:29 snapshot-dependencies
drwxr-xr-x  3 user  staff   96 Jun 21 11:29 spring-boot-loader
$

However, if I use a wrong option, it seems to fail silently as follows:

$ ./gradlew clean bootJar

BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed
$ java -Djarmode=layertools -jar build/libs/spring-boot-throwaway-branches-1.0.jar extract --destination=build/temp
$ ls -al build/temp/
ls: build/temp/: No such file or directory
$ ls -al
total 56
drwxr-xr-x  15 user  staff   480 Jun 21 11:30 .
drwxr-xr-x  67 user  staff  2144 Jun 18 16:35 ..
drwxr-xr-x  16 user  staff   512 Jun 21 11:27 .git
-rw-r--r--   1 user  staff   109 Jun 11 09:56 .gitignore
drwxr-xr-x  12 user  staff   384 Jun 20 22:29 .gradle
drwxr-xr-x  14 user  staff   448 Jun 21 11:24 .idea
drwxr-xr-x   7 user  staff   224 Jun 21 11:30 build
-rw-r--r--   1 user  staff  1151 Jun 21 10:38 build.gradle
drwxr-xr-x   3 user  staff    96 Dec 12  2018 gradle
-rw-r--r--   1 user  staff     0 Jun 12 15:57 gradle.properties
-rwxr-xr-x   1 user  staff  5770 Jun 12 16:50 gradlew
-rw-r--r--   1 user  staff  3058 Jun 12 16:50 gradlew.bat
-rw-r--r--   1 user  staff    53 Dec 12  2018 settings.gradle
-rw-r--r--   1 user  staff   760 Dec 12  2018 spring-boot-throwaway-branches.iml
drwxr-xr-x   4 user  staff   128 Nov  7  2019 src
$ 

If I omit the destination option, it succeeds as follows:

$ java -Djarmode=layertools -jar build/libs/spring-boot-throwaway-branches-1.0.jar extract
$ ls -al
total 56
drwxr-xr-x  19 user  staff   608 Jun 21 11:31 .
drwxr-xr-x  67 user  staff  2144 Jun 18 16:35 ..
drwxr-xr-x  16 user  staff   512 Jun 21 11:27 .git
-rw-r--r--   1 user  staff   109 Jun 11 09:56 .gitignore
drwxr-xr-x  12 user  staff   384 Jun 20 22:29 .gradle
drwxr-xr-x  14 user  staff   448 Jun 21 11:24 .idea
drwxr-xr-x   4 user  staff   128 Jun 21 11:31 application
drwxr-xr-x   7 user  staff   224 Jun 21 11:30 build
-rw-r--r--   1 user  staff  1151 Jun 21 10:38 build.gradle
drwxr-xr-x   3 user  staff    96 Jun 21 11:31 dependencies
drwxr-xr-x   3 user  staff    96 Dec 12  2018 gradle
-rw-r--r--   1 user  staff     0 Jun 12 15:57 gradle.properties
-rwxr-xr-x   1 user  staff  5770 Jun 12 16:50 gradlew
-rw-r--r--   1 user  staff  3058 Jun 12 16:50 gradlew.bat
-rw-r--r--   1 user  staff    53 Dec 12  2018 settings.gradle
drwxr-xr-x   2 user  staff    64 Jun 21 11:31 snapshot-dependencies
drwxr-xr-x   3 user  staff    96 Jun 21 11:31 spring-boot-loader
-rw-r--r--   1 user  staff   760 Dec 12  2018 spring-boot-throwaway-branches.iml
drwxr-xr-x   4 user  staff   128 Nov  7  2019 src
$
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 21, 2020
@philwebb
Copy link
Member

Yeah, I've hit that one before as well. I think we should consider this a bug.

@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 22, 2020
@philwebb philwebb added this to the 2.3.x milestone Jun 22, 2020
@scottfrederick scottfrederick self-assigned this Jun 25, 2020
@scottfrederick
Copy link
Contributor

scottfrederick commented Jun 26, 2020

However, if I use a wrong option, it seems to fail silently as follows:

For the record, what's happening is that --destination=build/temp isn't recognized as a valid option so it is being treated as a layer parameter. Since there are no layers named --destination=build/temp to extract, the command runs but has nothing to do. The validation should be tightened up so that an unrecognized option (e.g. something that starts with "--") results in an error.

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

No branches or pull requests

4 participants