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
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,28 @@ public void testitMNG1021()
verifier.verifyErrorFreeLog();
verifier.resetStreams();

verifier.assertArtifactPresent( "org.apache.maven.its.mng1021", "test", "SNAPSHOT", "pom" );
verifier.assertArtifactPresent( "org.apache.maven.its.mng1021", "test", "SNAPSHOT", "jar" );
verifier.assertArtifactPresent( "org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "pom" );
verifier.assertArtifactPresent( "org.apache.maven.its.mng1021", "test", "1-SNAPSHOT", "jar" );

String dir = "repo/org/apache/maven/its/mng1021/test/";
String snapshot = getSnapshotVersion( new File( testDir, dir + "SNAPSHOT" ) );
String snapshot = getSnapshotVersion( new File( testDir, dir + "1-SNAPSHOT" ) );
assertTrue( snapshot, snapshot.endsWith( "-1" ) );

verifier.assertFilePresent( dir + "maven-metadata.xml" );
verifier.assertFilePresent( dir + "maven-metadata.xml.md5" );
verifier.assertFilePresent( dir + "maven-metadata.xml.sha1" );
verifier.assertFilePresent( dir + "SNAPSHOT/maven-metadata.xml" );
verifier.assertFilePresent( dir + "SNAPSHOT/maven-metadata.xml.md5" );
verifier.assertFilePresent( dir + "SNAPSHOT/maven-metadata.xml.sha1" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".pom" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".pom.md5" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".pom.sha1" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".jar" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".jar.md5" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + ".jar.sha1" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + "-it.jar" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + "-it.jar.md5" );
verifier.assertFilePresent( dir + "SNAPSHOT/test-" + snapshot + "-it.jar.sha1" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml.md5" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/maven-metadata.xml.sha1" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom.md5" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".pom.sha1" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar.md5" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + ".jar.sha1" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.md5" );
verifier.assertFilePresent( dir + "1-SNAPSHOT/test-" + snapshot + "-it.jar.sha1" );
}

private String getSnapshotVersion( File artifactDir )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,37 @@ public void testit()

Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
try {
verifier.executeGoal( "validate" );
}
catch ( VerificationException e )
{
// expected with Maven 4+
}
verifier.resetStreams();

String logLevel;
if ( matchesVersionRange( "(,4.0.0-alpha-1)" ) )
{
logLevel = "WARNING";
}
else
{
logLevel = "ERROR";
}

List<String> lines = verifier.loadLines( verifier.getLogFileName(), "UTF-8" );
boolean foundWarning = false;
boolean foundMessage = false;
for ( String line : lines )
{
if ( line.startsWith( "[WARNING]" )
if ( line.startsWith( "[" + logLevel + "]" )
&& line.indexOf( "duplicate declaration of plugin org.apache.maven.its.plugins:maven-it-plugin-expression" ) > 0 )
{
foundWarning = true;
foundMessage = true;
}
}

assertTrue( "Duplicate plugin warning wasn't generated.", foundWarning );
assertTrue( "Duplicate plugin message wasn't generated.", foundMessage );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class MavenITmng3719PomExecutionOrderingTest

public MavenITmng3719PomExecutionOrderingTest()
{
super( "[2.0.11,2.1.0-M1),[2.1.0-M2,)" );
super( "[2.0.11,2.1.0-M1),[2.1.0-M2,4.0.0-alpha-1)" );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,36 @@ private void test( String project )
Verifier verifier = newVerifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "target" );
verifier.executeGoal( "validate" );
verifier.verifyErrorFreeLog();
try {
verifier.executeGoal( "validate" );
}
catch ( VerificationException e )
{
// expected with Maven 4+
}
verifier.resetStreams();

String logLevel;
if ( matchesVersionRange( "(,4.0.0-alpha-1)" ) )
{
logLevel = "WARNING";
}
else
{
logLevel = "ERROR";
}

List<String> lines = verifier.loadLines( verifier.getLogFileName(), "UTF-8" );
boolean foundWarning = false;
boolean foundMessage = false;
for ( String line : lines )
{
if ( line.startsWith( "[WARNING]" ) && line.indexOf( "must be unique: junit:junit:jar" ) > 0 )
if ( line.startsWith( "[" + logLevel + "]" ) && line.indexOf( "must be unique: junit:junit:jar" ) > 0 )
{
foundWarning = true;
foundMessage = true;
}
}

assertTrue( "Duplicate dependency warning wasn't generated.", foundWarning );
assertTrue( "Duplicate dependency message wasn't generated.", foundMessage );
}

}
48 changes: 48 additions & 0 deletions core-it-suite/src/test/resources/bootstrap/group-13/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven.its.bootstrap</groupId>
<artifactId>maven-it-boostrap</artifactId>
<version>1.0</version>
</parent>

<groupId>org.apache.maven.its.bootstrap</groupId>
<artifactId>group-13</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<name>Maven Integration Test :: Boostrap :: Group-13</name>

<properties>
</properties>

<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies>
</project>
5 changes: 0 additions & 5 deletions core-it-suite/src/test/resources/bootstrap/group-8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ under the License.
<artifactId>plexus-utils</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
1 change: 1 addition & 0 deletions core-it-suite/src/test/resources/bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ under the License.
<module>group-10</module>
<module>group-11</module>
<module>group-12</module>
<module>group-13</module>
</modules>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-1021/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ under the License.

<groupId>org.apache.maven.its.mng1021</groupId>
<artifactId>test</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>

<name>Maven Integration Test :: MNG-1021</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/module1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.codehaus.jira.mng.XXX</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/module2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.codehaus.jira.mng.XXX</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/module3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.codehaus.jira.mng.XXX</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/module4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.codehaus.jira.mng.XXX</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/module5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.codehaus.jira.mng.XXX</groupId>
<artifactId>parent</artifactId>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>Parent POM for issue</name>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
<inceptionYear>2007</inceptionYear>

<build>
Expand Down
2 changes: 1 addition & 1 deletion core-it-suite/src/test/resources/mng-3259/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<artifactId>builder</artifactId>
<packaging>pom</packaging>
<name>Builder POM for issue XXX</name>
<version>SNAPSHOT</version>
<version>1-SNAPSHOT</version>
<inceptionYear>2007</inceptionYear>

<modules>
Expand Down