<#20229 Shading throws `NoSuchFileException` given...
# github-notifications
c
#20229 Shading throws `NoSuchFileException` given a `deploy_jar` in a subdirectory Issue created by grihabor Describe the bug Given a
deploy_jar
target in a subdirectory shading process throws an exception
NoSuchFileException
Pants version 2.18.0 OS Ubuntu 22.04 Additional info `helloworld/HelloWorld.java`:
Copy code
package helloworld;

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
`helloworld/BUILD`:
Copy code
java_sources(name="src")
`subdir/BUILD`:
Copy code
deploy_jar(
    name="fat",
    main="helloworld.HelloWorld",
    dependencies=["//helloworld:src"],
    shading_rules=[
        shading_keep(pattern="helloworld.**"),
    ],
)
It's important to put deploy_jar into a subdirectory. It works without errors if you put it into root BUILD file. Steps to reproduce: • pants generate-lockfiles • pants subdir:fat I get this:
Copy code
ProcessExecutionFailure: Process 'Shading JAR subdir/fat.jar' failed with exit code 899.
...
java.nio.file.NoSuchFileException: subdir/fat.jar
...
pantsbuild/pants