-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add appropriate application name to GAV deployments / FISH-1015 #5071
Conversation
deploymentMapEntry.getKey(), "--force=true", "--loadOnly", "true"); | ||
String artefactName= artefactURI.getPath().substring(artefactURI.getPath().lastIndexOf('/') + 1); | ||
// artefact name always has a valid extension | ||
String name = artefactName.substring(0, artefactName.length() - 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Could this be extracted to (tested) method?
- Could this variable be renamed to something like
nameWithExtension
- and above comment removed?
deploymentURLsMap.put(defaultContext, artefactMapEntry.getValue()); | ||
URL artefactURL = artefactMapEntry.getValue(); | ||
String artefactName = artefactURL.getPath().substring(artefactURL.getPath().lastIndexOf('/') + 1); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With above comment implemented - could new method be used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same code also in UberJarCreator class. Maybe make sense move this to utility class? Or such class already exists?
Can you put a problem example reproducer? Payara always has versioned deployment syntax wit a colon and not with a dash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #5071 (comment)
There some examples.
and deploy it with second --deployFromGAV option we have an deployment error.
last line give us exception or empty name and other exception in case of filename length <= 4 and unconditionally truncate last four chars otherwise.
|
This does not change versioning scheme. This patch try to make three things:
|
"true", "--contextroot", | ||
deploymentMapEntry.getKey(), "--force=true", "--loadOnly", "true"); | ||
String artefactName = getFileName(artefactURI.getPath()); | ||
String name = artefactName.substring(0, artefactName.length() - 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this will break in so many ways, I cannot count 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I understand. May be try to fix this by writing artifact with actual file name to a temporary directory instead of temp file?
There is reproducer https://github.com/avpinchuk/issue-gav
Install to your local repo and run micro (from current master)
java -jar payara-micro.jar --deployFromGAV org.apache.activemq:actevemq-rar:5.16.0 --deployFromGAV org.example:issue-gav:1.0 --additionalRepository file:///path/to/your/local/repo
I am working on some suggested simple changes... |
Close this PR? |
No
no |
I have a few more questions about Payara Micro boot time deployment. Where can they be discussed? |
there is a discussion forum on GitHub for Payara. Also, please take a look at the PR I made for your PR |
I have some questions. Take a look at code comments in your PR, please. |
refactored primitive obsession when getting file name from path to ex…
jenkins test |
No. Need fix. |
ok, just let us know when it's done |
Yes. Approx 1 hour |
I finished. Please take a look at my last commit. Thanks! |
jenkins test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little something I spotted.
} | ||
} | ||
|
||
private static boolean hasJavaArchiveExtension(String filePath) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably being blind, but is there a reason this is being made static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it has no access to fields. Good enough reason for me :)
Description
This is a bug fix.
Remote artifact deployed with a temporary name app...tmp. But, e.g., for MDBs we need to specify resource adapter name activation property and we get an deployment error. This fix changes deploy name to
artifactId-version
.When creating an uber jar a GAV artifacts are added with a context name, not a filename. When executes this uber jar an exception throws if context name length less than or equal 4. In other case we have an incomplete application name (context - last four chars). This fix writes GAV artifacts with their filenames and adds their contexts to the contexts.properties during uber jar creation.
Important Info
Blockers
Testing
New tests
Testing Performed
Testing Environment
Documentation
Notes for Reviewers