Put public folders inside public for executable war #538
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.
When running
java -jar project.jar -S, the extraction process:tmpfolder, deleted on process exitjarto thetmpfoldertmpis different than that of thewarwarble runnable warat the root of the project.This patch addresses step 2.
Previously, only files at the root were pulled back to
/public, leaving behind other directories at the root of thetmp.This is an issue because of
Rails.public_path.When running the
warinside a web container liketomcat:When running the
warwithjava -jar:So if you try to access resources from:
You're not going to find it because it's in:
This commit pulls back everything that is not
META-INFback into public.While this is —theoretically– the inverse operation of the bundling process, its soundness lives in code and not in data.
The optimal solution would be to bundle in the war a file listing all transformations that happened and reversing them properly when needed for
java -jarexecution.But to be completely honest, I don't understand why it was done this way in the first place, so maybe the whole thing is doing something wrong. However, the test suite is not complaining (I ran it in my own repo).