-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[MNG-8729] Use correct outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
#2312
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
Conversation
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
waiting for enabler |
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultModelXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
* @throws XmlReaderException if an error occurs during the parsing | ||
* @see #toXmlString(Object) | ||
*/ | ||
public static PluginDescriptor fromXml(@Nonnull String xml) throws XmlReaderException { |
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.
do we need this, as seems unused?
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Outdated
Show resolved
Hide resolved
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java
Show resolved
Hide resolved
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.
The point of this PR is to fix the call with the output stream. Please rename it accordingly.
stream
in DefaultPluginXmlFactory#write
os
use correct outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
os
use correct outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
rdy. lets hope windows-ci make is this time. |
outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
outputStream
destination; request
instead of path
in DefaultPluginXmlFactory#write
The UTs are failing on windows |
yes thx. items: Error: DefaultPluginXmlFactoryReadWriteTest.readFromUrlParsesPluginDescriptorCorrectly � JUnit Failed to close extension context Error: org.apache.maven.impl.DefaultPluginXmlFactoryReadWriteTest.readFromUrlParsesPluginDescriptorCorrectly -- Time elapsed: 0.016 s <<< ERROR! |
|
… DefaultPluginXmlFactory#write
disabled failing test. found then other disabled and removed that one. Lets see. |
We need to fix maven/impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultPluginXmlFactory.java Lines 55 to 56 in 717b959
|
what to be done, except of giving dedication? |
merci |
…ath in DefaultPluginXmlFactory#write (apache#2312) Co-authored-by: Vincent Potucek <[email protected]>
The Spring codebase sometimes ignores exceptions in catch blocks on purpose. This is often called out by an inline comment. We should make this more obvious by renaming the exception argument in the catch block to declare whether the exception is "ignored" or "expected". See gh-35047 Signed-off-by: Vincent Potucek <[email protected]> [[email protected]: rework commit message] Signed-off-by: Brian Clozel <[email protected]>
Resolve #9348 |
The test has an InputStream that is not closed for this file ( |
Path xmlFile = tempDir.resolve("plugin.xml"); | ||
Files.write(xmlFile, SAMPLE_PLUGIN_XML.getBytes()); | ||
PluginDescriptor descriptor = defaultPluginXmlFactory.read(XmlReaderRequest.builder() | ||
.inputStream(xmlFile.toUri().toURL().openStream()) |
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.
This input stream for plugin.xml
is not closed, leading to a failure to clean up the test context. (On windows and certain Linux file systems (eg NFS)).
Windows (generally) will not let you delete a file that has open handles even if it is the same process or thread that has the open handle)
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.
Nice catch, raised #11069
|
||
@Test | ||
@Disabled("maybe bug in JUnit, as MS-DOS only https://github.com/apache/maven/pull/2312#issuecomment-2876291814") | ||
void readFromUrlParsesPluginDescriptorCorrectly() throws Exception { |
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.
Am I missing the bit reading from a URL?
The XmlReaderRequest
is built using an InputStream not a URL
thanks for feedback. |
JIRA issue: MNG-8729
follow up of:
stream
inDefaultPluginXmlFactory#write
#2303ref:
finally 100