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
2 changes: 1 addition & 1 deletion modello-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<debug>true</debug>
<filterProperties>
<plexusUtilsVersion>3.6.1</plexusUtilsVersion>
<junit4Version>${junit4Version}</junit4Version>
<junit5Version>${version.junit5}</junit5Version>
<java.version>${java.version}</java.version>
<jdom.version>${jdom.version}</jdom.version>
</filterProperties>
Expand Down
13 changes: 7 additions & 6 deletions modello-maven-plugin/src/it/clone-java5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<version>@plexusUtilsVersion@</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>@junit4Version@</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>@junit5Version@</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -31,7 +32,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -40,12 +41,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import org.codehaus.plexus.util.xml.Xpp3Dom;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;

public class CloneTest
{
Expand Down
13 changes: 7 additions & 6 deletions modello-maven-plugin/src/it/clone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
<version>@plexusUtilsVersion@</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>@junit4Version@</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>@junit5Version@</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand All @@ -31,7 +32,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -40,12 +41,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import org.codehaus.plexus.util.xml.Xpp3Dom;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;

public class CloneTest
{
Expand Down
6 changes: 3 additions & 3 deletions modello-maven-plugin/src/it/dom4j-no-plexus-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -38,12 +38,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
6 changes: 3 additions & 3 deletions modello-maven-plugin/src/it/features/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -62,12 +62,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
13 changes: 7 additions & 6 deletions modello-maven-plugin/src/it/javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
<version>@plexusUtilsVersion@</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>@junit4Version@</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>@junit5Version@</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -50,7 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -59,12 +60,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
6 changes: 3 additions & 3 deletions modello-maven-plugin/src/it/jdom-no-plexus-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -38,12 +38,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
9 changes: 5 additions & 4 deletions modello-maven-plugin/src/it/maven-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand Down Expand Up @@ -49,9 +49,10 @@
<version>@plexusUtilsVersion@</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>@junit4Version@</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>@junit5Version@</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,61 +1,55 @@
package org.codehaus.modello.xpp3;

import static org.hamcrest.CoreMatchers.startsWith;
import java.io.File;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.hamcrest.core.StringStartsWith;
import org.junit.jupiter.api.Test;

import java.io.File;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

/** @author Jason van Zyl */
public class Xpp3ParsingTest
{
@Rule
public ExpectedException thrown= ExpectedException.none();

@Test
public void testXpp3ParsingWithModelWithWrongRootTag()
private static String readFailure( String modelFile )
throws Exception
{
thrown.expectMessage( startsWith( "Expected root element 'project' but found 'model' (position: START_TAG seen <model>... @1:8" ) );

File model = new File( System.getProperty( "basedir" ), "src/test/models/model-with-wrong-root-tag.xml" );
File model = new File( System.getProperty( "basedir" ), "src/test/models/" + modelFile );

MavenXpp3Reader reader = new MavenXpp3Reader();

reader.read( new XmlStreamReader( model ), true );
XmlPullParserException e =
assertThrows( XmlPullParserException.class, () -> reader.read( new XmlStreamReader( model ), true ) );
return e.getMessage();
}

@Test
public void testXpp3ParsingWithModelWithMissingElements()
public void testXpp3ParsingWithModelWithWrongRootTag()
throws Exception
{
thrown.expectMessage( startsWith( "Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>" ) );

File model = new File( System.getProperty( "basedir" ), "src/test/models/model-with-missing-elements.xml" );

MavenXpp3Reader reader = new MavenXpp3Reader();
String message = readFailure( "model-with-wrong-root-tag.xml" );
assertTrue( message.startsWith(
"Expected root element 'project' but found 'model' (position: START_TAG seen <model>... @1:8" ), message );
}

reader.read( new XmlStreamReader( model ), true );
@Test
public void testXpp3ParsingWithModelWithMissingElements()
throws Exception
{
String message = readFailure( "model-with-missing-elements.xml" );
assertTrue( message.startsWith( "Unrecognised tag: 'groupId' (position: START_TAG seen ...<dependencies>" ),
message );
}

@Test
public void testXpp3ParsingWithModelWithPostTags()
throws Exception
{
// internal message from MXParser
thrown.expectMessage( startsWith( "start tag not allowed in epilog" ) );

File model = new File( System.getProperty( "basedir" ), "src/test/models/model-with-post-tags.xml" );

MavenXpp3Reader reader = new MavenXpp3Reader();

reader.read( new XmlStreamReader( model ), true );
String message = readFailure( "model-with-post-tags.xml" );
assertTrue( message.startsWith( "start tag not allowed in epilog" ), message );
}

}
2 changes: 1 addition & 1 deletion modello-maven-plugin/src/it/snakeyaml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand Down
6 changes: 3 additions & 3 deletions modello-maven-plugin/src/it/stax-no-plexus-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.14.1</version>
<configuration>
<source>@javaVersion@</source>
<target>@javaVersion@</target>
Expand All @@ -44,12 +44,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.5.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
Expand Down
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@
<slf4j.version>1.7.36</slf4j.version>
<sisu.version>1.1.1</sisu.version>
<mavenVersion>3.6.3</mavenVersion>
<junit4Version>4.13.2</junit4Version>
<project.build.outputTimestamp>2026-08-30T21:30:18Z</project.build.outputTimestamp>
</properties>

Expand Down Expand Up @@ -330,11 +329,6 @@
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit4Version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-testing</artifactId>
Expand Down
Loading