This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new f169cf762b Fix XMLReader#getURL and enable the unit test (#11069)
f169cf762b is described below
commit f169cf762bf22f090cd722c706ca901b25db8d99
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Aug 29 14:46:27 2025 +0200
Fix XMLReader#getURL and enable the unit test (#11069)
---
.../org/apache/maven/api/services/xml/XmlReaderRequest.java | 2 +-
.../org/apache/maven/impl/DefaultPluginXmlFactoryTest.java | 12 +++---------
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git
a/api/maven-api-core/src/main/java/org/apache/maven/api/services/xml/XmlReaderRequest.java
b/api/maven-api-core/src/main/java/org/apache/maven/api/services/xml/XmlReaderRequest.java
index d6fc50e911..41733eb08b 100644
---
a/api/maven-api-core/src/main/java/org/apache/maven/api/services/xml/XmlReaderRequest.java
+++
b/api/maven-api-core/src/main/java/org/apache/maven/api/services/xml/XmlReaderRequest.java
@@ -208,7 +208,7 @@ public Path getRootDirectory() {
@Override
public URL getURL() {
- return null;
+ return url;
}
@Override
diff --git
a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java
b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java
index 37e320cb32..4031fb9186 100644
---
a/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java
+++
b/impl/maven-impl/src/test/java/org/apache/maven/impl/DefaultPluginXmlFactoryTest.java
@@ -37,7 +37,6 @@
import org.apache.maven.api.services.xml.XmlWriterRequest;
import org.apache.maven.impl.model.DefaultModelProcessor;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.io.TempDir;
import static java.util.UUID.randomUUID;
@@ -45,11 +44,10 @@
import static
org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.condition.OS.WINDOWS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-class DefaultPluginXmlFactoryReadWriteTest {
+class DefaultPluginXmlFactoryTest {
private static final String NAME = "sample-plugin-" + randomUUID();
private static final String SAMPLE_PLUGIN_XML =
@@ -252,15 +250,11 @@ void
locateExistingPomWithFilePathShouldReturnSameFileIfRegularFile() throws IOE
}
@Test
- @DisabledOnOs(
- value = WINDOWS,
- disabledReason = "windows related issue
https://github.com/apache/maven/pull/2312#issuecomment-2876291814")
void readFromUrlParsesPluginDescriptorCorrectly() throws Exception {
Path xmlFile = tempDir.resolve("plugin.xml");
Files.write(xmlFile, SAMPLE_PLUGIN_XML.getBytes());
- PluginDescriptor descriptor =
defaultPluginXmlFactory.read(XmlReaderRequest.builder()
- .inputStream(xmlFile.toUri().toURL().openStream())
- .build());
+ PluginDescriptor descriptor = defaultPluginXmlFactory.read(
+
XmlReaderRequest.builder().url(xmlFile.toUri().toURL()).build());
assertThat(descriptor.getName()).isEqualTo(NAME);
assertThat(descriptor.getGroupId()).isEqualTo("org.example");
assertThat(descriptor.getArtifactId()).isEqualTo("sample-plugin");