|
29 | 29 |
|
30 | 30 | import org.apache.commons.io.FileUtils; |
31 | 31 | import org.apache.maven.AbstractCoreMavenComponentTestCase; |
| 32 | +import org.apache.maven.artifact.InvalidArtifactRTException; |
32 | 33 | import org.apache.maven.execution.MavenSession; |
33 | 34 | import org.apache.maven.model.Plugin; |
34 | 35 | import org.apache.maven.model.building.FileModelSource; |
@@ -236,17 +237,18 @@ public void testReadInvalidPom() |
236 | 237 | getContainer().lookup( org.apache.maven.project.ProjectBuilder.class ); |
237 | 238 |
|
238 | 239 | // single project build entry point |
239 | | - Exception ex = assertThrows( Exception.class, () -> projectBuilder.build( pomFile, configuration ) ); |
240 | | - assertThat( ex.getMessage(), containsString( "expected START_TAG or END_TAG not TEXT" ) ); |
| 240 | + InvalidArtifactRTException ex = assertThrows( InvalidArtifactRTException.class, () -> projectBuilder.build( pomFile, configuration ) ); |
| 241 | + assertThat( ex.getMessage(), containsString( "The groupId cannot be empty." ) ); |
241 | 242 |
|
242 | 243 | // multi projects build entry point |
243 | 244 | ProjectBuildingException pex = |
244 | 245 | assertThrows( ProjectBuildingException.class, |
245 | 246 | () -> projectBuilder.build( Collections.singletonList( pomFile ), false, configuration ) ); |
246 | 247 | assertEquals( 1, pex.getResults().size() ); |
247 | 248 | assertNotNull( pex.getResults().get( 0 ).getPomFile() ); |
| 249 | + assertNotNull( pex.getResults().get( 0 ).getProject() ); |
248 | 250 | assertThat( pex.getResults().get( 0 ).getProblems().size(), greaterThan( 0 ) ); |
249 | | - assertThat( pex.getResults(), contains( projectBuildingResultWithProblemMessage( "expected START_TAG or END_TAG not TEXT" ) ) ); |
| 251 | + assertThat( pex.getResults(), contains( projectBuildingResultWithProblemMessage( "'groupId' is missing." ) ) ); |
250 | 252 | } |
251 | 253 |
|
252 | 254 | @Test |
|
0 commit comments