Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions maven-plugin-testing-harness/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ under the License.
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.2</version>
<version>5.11.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -116,7 +116,6 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.util.InterpolationFilterReader;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.ReflectionUtils;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.XmlStreamReader;
Expand Down Expand Up @@ -297,7 +296,7 @@ protected <T extends Mojo> T lookupEmptyMojo(String goal, String pluginPom) thro
protected <T extends Mojo> T lookupMojo(String goal, File pom) throws Exception {
File pluginPom = new File(getBasedir(), "pom.xml");

Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(pluginPom));
Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(new XmlStreamReader(pluginPom));

String artifactId = pluginPomDom.getChild("artifactId").getValue();

Expand All @@ -321,7 +320,7 @@ protected <T extends Mojo> T lookupMojo(String goal, File pom) throws Exception
protected <T extends Mojo> T lookupEmptyMojo(String goal, File pom) throws Exception {
File pluginPom = new File(getBasedir(), "pom.xml");

Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(pluginPom));
Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(new XmlStreamReader(pluginPom));

String artifactId = pluginPomDom.getChild("artifactId").getValue();

Expand Down Expand Up @@ -507,7 +506,7 @@ private void finalizeMojoConfiguration(MojoExecution mojoExecution) {
*/
protected PlexusConfiguration extractPluginConfiguration(String artifactId, File pom) throws Exception {

try (Reader reader = ReaderFactory.newXmlReader(pom)) {
try (Reader reader = new XmlStreamReader(pom)) {
Xpp3Dom pomDom = Xpp3DomBuilder.build(reader);
return extractPluginConfiguration(artifactId, pomDom);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.testing.PlexusExtension;
import org.codehaus.plexus.util.InterpolationFilterReader;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.ReflectionUtils;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.codehaus.plexus.util.xml.Xpp3Dom;
Expand Down Expand Up @@ -203,18 +202,18 @@ private Mojo lookupMojo(
Xpp3Dom pomDom;
if (pom.startsWith("file:")) {
Path path = Paths.get(getBasedir()).resolve(pom.substring("file:".length()));
pomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(path.toFile()));
pomDom = Xpp3DomBuilder.build(new XmlStreamReader(path.toFile()));
} else if (pom.startsWith("classpath:")) {
URL url = holder.getResource(pom.substring("classpath:".length()));
if (url == null) {
throw new IllegalStateException("Unable to find pom on classpath: " + pom);
}
pomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(url.openStream()));
pomDom = Xpp3DomBuilder.build(new XmlStreamReader(url.openStream()));
} else if (pom.contains("<project>")) {
pomDom = Xpp3DomBuilder.build(new StringReader(pom));
} else {
Path path = Paths.get(getBasedir()).resolve(pom);
pomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(path.toFile()));
pomDom = Xpp3DomBuilder.build(new XmlStreamReader(path.toFile()));
}
Xpp3Dom pluginConfiguration = extractPluginConfiguration(coord[1], pomDom);
if (!mojoParameters.isEmpty()) {
Expand All @@ -238,7 +237,7 @@ protected String[] mojoCoordinates(String goal) throws Exception {
return goal.split(":");
} else {
Path pluginPom = Paths.get(getBasedir(), "pom.xml");
Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(ReaderFactory.newXmlReader(pluginPom.toFile()));
Xpp3Dom pluginPomDom = Xpp3DomBuilder.build(new XmlStreamReader(pluginPom.toFile()));
String artifactId = pluginPomDom.getChild("artifactId").getValue();
String groupId = resolveFromRootThenParent(pluginPomDom, "groupId");
String version = resolveFromRootThenParent(pluginPomDom, "version");
Expand All @@ -263,11 +262,10 @@ protected Mojo lookupMojo(String[] coord, Xpp3Dom pluginConfiguration, PluginDes
}
if (pluginConfiguration != null) {
MavenSession session = getContainer().lookup(MavenSession.class);
MavenProject project;
try {
project = getContainer().lookup(MavenProject.class);
} catch (ComponentLookupException e) {
project = null;
getContainer().lookup(MavenProject.class);
} catch (ComponentLookupException ignore) {
// nothing
}
MojoExecution mojoExecution;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;

Expand Down Expand Up @@ -186,7 +186,7 @@ protected void readModel(File pomFile) {
pomFile = new File(getBasedir(), pomFile.getPath());
}
try {
setModel(new MavenXpp3Reader().read(ReaderFactory.newXmlReader(pomFile)));
setModel(new MavenXpp3Reader().read(new XmlStreamReader(pomFile)));
} catch (IOException e) {
throw new RuntimeException("Failed to read POM file: " + pomFile, e);
} catch (XmlPullParserException e) {
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>42</version>
<version>43</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -64,8 +64,7 @@ under the License.
</distributionManagement>

<properties>
<surefire.version>3.2.5</surefire.version>
<mavenVersion>3.9.6</mavenVersion>
<mavenVersion>3.9.9</mavenVersion>
<maven.site.path>plugin-testing-archives/LATEST</maven.site.path>
<javaVersion>8</javaVersion>
<project.build.outputTimestamp>2023-11-07T21:58:12Z</project.build.outputTimestamp>
Expand Down