bazel-contrib / bazel-contrib/rules_jvm_external

MergeJars doesn't handle LICENSE directory correctly

Open
#583 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

When using `java_export` it fails to run MergeJars with

```
Exception in thread "main" java.nio.file.FileSystemException: /var/folders/gm/ld3w53xd25v2pjcllsv6wtqh0000gn/T/mergejars10731205331298143417/LICENSE: Is a directory
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
at java.base/java.nio.file.Files.newOutputStream(Files.java:219)
at rules.jvm.external.jar.DuplicateEntryStrategy$1.resolve(DuplicateEntryStrategy.java:22)
at rules.jvm.external.jar.MergeJars.main(MergeJars.java:159)
```

This is coming from a jar which is fetched via `http_jar` so doesn't have `maven_coordinates` and is in the `deps` of the `java_export`

Contributor guide

Open the contributing guide

Research direction

Start in rules.jvm.external.jar.DuplicateEntryStrategy.java at resolve(), then trace how MergeJars.java handles entries from an http_jar dependency without maven_coordinates. Reproduce the java_export failure with a dependency containing a LICENSE directory and verify that MergeJars completes without treating the directory as a file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.