This repository was archived by the owner on Jan 29, 2020. It is now read-only.
[MJAVADOC-489] Find the main module descriptor#137
Open
io7m wants to merge 2 commits intoapache:trunkfrom
Open
[MJAVADOC-489] Find the main module descriptor#137io7m wants to merge 2 commits intoapache:trunkfrom
io7m wants to merge 2 commits intoapache:trunkfrom
Conversation
The existing code was checking for the existence of a file "src/main/module-info.java" relative to the current directory. The problem is that in a multi-module build, the current directory is the project root, not the root of the current module. As a result, the module descriptor was not being found and all dependencies were ending up on the classpath instead. Fixes: MJAVADOC-489
eolivelli
reviewed
Nov 18, 2017
| for ( String root : roots ) | ||
| { | ||
| File descriptorFile = new File( root, "module-info.java" ).getAbsoluteFile(); | ||
| if ( descriptorFile.exists() ) |
There was a problem hiding this comment.
Won't be better isFile() instead of exists() ?
Author
There was a problem hiding this comment.
Actually, I'm kind of inclined to fail hard and fast if something exists called module-info.java that isn't a regular file. That almost certainly indicates some sort of problem in the build elsewhere.
This adjusts the previous patch to quickly and loudly reject filesystem entries named module-info.java that turn out not to be regular files. Affects: MJAVADOC-489
Author
|
It looks like only half of this got merged as I didn't use the same ticket title on the second commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing code was checking for the existence of a file
"src/main/module-info.java" relative to the current directory. The
problem is that in a multi-module build, the current directory is
the project root, not the root of the current module. As a result,
the module descriptor was not being found and all dependencies were
ending up on the classpath instead.
Fixes: MJAVADOC-489