This command here is working as I run it in the command line from /home/username/workspaces/meditation-new
:
jar -uf server/build/libs/server-*.jar mobile-client/build/BOOT-INF
But running it with gradle:
doFirst {
exec {
executable = 'jar'
args = [
'uf',
"server/build/libs/server-*.jar",
"mobile-client/build/BOOT-INF"
]
}
}
Fails because of
java.io.FileNotFoundException: server/build/libs/server-*.jar (No such file or directory)
Running gradle with the -i
switch on shows me however, that the command is correctly exectued:
Starting process 'command 'jar''. Working directory: /home/username/workspaces/meditation-new Command: jar uf server/build/libs/server-*.jar mobile-client/build/BOOT-INF
Successfully started process 'command 'jar''
java.io.FileNotFoundException: server/build/libs/server-*.jar (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at jdk.jartool/sun.tools.jar.Main.run(Main.java:360)
at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)
:copyWebApp (Thread[Execution worker for ':',5,main]) completed. Took 0.079 secs.
What is the issue here?
question from:
https://stackoverflow.com/questions/65651365/filenotfoundexception-in-exec 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…