From 07187302705f8c9cd6a40ca4b43beb179ae0fef8 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 28 Nov 2008 17:15:26 +0000 Subject: [PATCH] o Decoupled it0068 from Modello Plugin git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@721538 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/it/MavenIT0068Test.java | 28 +- .../src/test/resources/it0068/pom.xml | 81 +- .../its/mng836/parent/0.1/parent-0.1.pom | 65 ++ .../its/mng836/parent/maven-metadata.xml | 11 + .../maven/its/mng836/maven-metadata.xml | 9 + .../plugin/0.1-SNAPSHOT/maven-metadata.xml | 11 + .../0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.jar | Bin 0 -> 7561 bytes .../0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.pom | 70 ++ .../its/mng836/plugin/maven-metadata.xml | 12 + .../src/test/resources/it0068/test.mdo | 769 ------------------ 10 files changed, 263 insertions(+), 793 deletions(-) create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/0.1/parent-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.jar create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.pom create mode 100644 its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/maven-metadata.xml delete mode 100644 its/core-it-suite/src/test/resources/it0068/test.mdo diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0068Test.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0068Test.java index e4cd376574..ff44484ba0 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0068Test.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenIT0068Test.java @@ -25,27 +25,33 @@ import org.apache.maven.it.util.ResourceExtractor; import java.io.File; import java.util.Properties; +/** + * This is a test set for MNG-836. + * + * @author Benjamin Bentmann + * @version $Id$ + */ public class MavenIT0068Test extends AbstractMavenIntegrationTestCase { /** - * Test repository accumulation. + * Test that parent POMs referenced by a plugin POM can be resolved from ordinary repos, i.e. non-plugin repos. + * As a motivation for this, imagine the plugin repository hosts only snapshots while the ordinary repository + * hosts releases and a snapshot plugin might easily use a released parent. */ - public void testit0068() + public void testitMNG836() throws Exception { File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/it0068" ); + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); - verifier.deleteArtifact( "org.codehaus.modello", "modello-core", "1.0-alpha-3", "jar" ); - Properties verifierProperties = new Properties(); - verifierProperties.put( "failOnErrorOutput", "false" ); - verifier.setVerifierProperties( verifierProperties ); - verifier.executeGoal( "generate-sources" ); - verifier.assertFilePresent( "target/generated-sources/modello/org/apache/maven/settings/Settings.java" ); -// don't verify error free log + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng836" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); verifier.resetStreams(); - } -} +} diff --git a/its/core-it-suite/src/test/resources/it0068/pom.xml b/its/core-it-suite/src/test/resources/it0068/pom.xml index 696b92d205..01890924e2 100644 --- a/its/core-it-suite/src/test/resources/it0068/pom.xml +++ b/its/core-it-suite/src/test/resources/it0068/pom.xml @@ -1,28 +1,83 @@ + + + + + 4.0.0 - Maven Integration Test :: it0068 - org.apache.maven.its.it0068 - maven-it-it0068 - Test repository accumulation. + org.apache.maven.its.mng836 + test 1.0-SNAPSHOT + + Maven Integration Test :: MNG-836 + + Test that parent POMs referenced by a plugin POM can be resolved from ordinary repos, i.e. non-plugin repos. + As a motivation for this, imagine the plugin repository hosts only snapshots while the ordinary repository + hosts releases and a snapshot plugin might easily use a released parent. + + + + + maven-core-it-repo-0 + file:///${basedir}/repo-0 + + ignore + + + ignore + + + + + + maven-core-it-repo-1 + file:///${basedir}/repo-1 + + ignore + + + ignore + + + + - org.codehaus.modello - modello-maven-plugin - 1.0-alpha-7 + + org.apache.maven.its.mng836 + plugin + 0.1-SNAPSHOT + test + validate - xpp3-writer - java - xpp3-reader + touch - 1.0.0 - test.mdo - false + target/test.txt diff --git a/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/0.1/parent-0.1.pom b/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/0.1/parent-0.1.pom new file mode 100644 index 0000000000..011d17f030 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/0.1/parent-0.1.pom @@ -0,0 +1,65 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng836 + parent + 0.1 + pom + + + + maven-core-it + file:///${basedir}/repo + + + + + true + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/maven-metadata.xml new file mode 100644 index 0000000000..5535fe3d26 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0068/repo-0/org/apache/maven/its/mng836/parent/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.mng836 + parent + 0.1 + + + 0.1 + + 20081128163134 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/maven-metadata.xml new file mode 100644 index 0000000000..55e968f0f3 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/maven-metadata.xml @@ -0,0 +1,9 @@ + + + + Unnamed - org.apache.maven.its.mng836:plugin:maven-plugin:0.1-SNAPSHOT + + plugin + + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/maven-metadata.xml new file mode 100644 index 0000000000..24c583d941 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.its.mng836 + plugin + 0.1-SNAPSHOT + + + 1 + + 20081128163159 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.jar b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/0.1-SNAPSHOT/plugin-0.1-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..21e85ea0f84c2e041f4418f1872320bc10f2452a GIT binary patch literal 7561 zcmeHLc|4SB8y;lK&V)&1iDa3Pea|}9k!`F=L-u9ti9}Mi6QYo0uNeDU$(}8{V_!lU z5z2PxROFk9V=_6NukXL__dAc@`_60TzOLtf?&p4<_kJ#2Euuq*0pHqhSEP0xcJAbu z516WQ`FIbsu~!AVbC>LN4vI`Ah?%G zOOUUtqq|gJs9$7i#zR1}t5rZtP>GBbon>@~k-zSQ@3Z7ceFiOk1Fr{s`M_fo^l>8k zN3Jlm>#t#c(G>C2tb3zVpi@A5HKM>+Q@quUK`z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$Y#h~TnzaVJD` zNJ~InyGwnbofz~u!Bjsl;eLWE!nwKqu8Cpnz4*j)goeg321zO8Wt12xmw*sR^!HLU zW{8+Z3wW=H{oETZ4tB6KjWx!$tZOGR_dVEmLN$)zU={fr{9DI0-!uHBCgQxtD&srG zJ9n(my3?>;FJK%1=;Ulmr^G?Ges0jAyEI$KcRc9Pfd_VA?J;kcfIJnJ0@V%GM z-;Wn7zT#N!|Ab{v`^1sq3#t2qH;f_M(X9U-fmN+>-GAOi>}uG555ub1I2Z>; + + + + + 4.0.0 + + + org.apache.maven.its.mng836 + parent + 0.1 + + + org.apache.maven.its.mng836 + plugin + 0.1-SNAPSHOT + maven-plugin + + + + maven-core-it + file:///${basedir}/repo + false + + + + + true + + + + + org.apache.maven + maven-plugin-api + + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/maven-metadata.xml b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/maven-metadata.xml new file mode 100644 index 0000000000..208c8e0308 --- /dev/null +++ b/its/core-it-suite/src/test/resources/it0068/repo-1/org/apache/maven/its/mng836/plugin/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.maven.its.mng836 + plugin + 0.1-SNAPSHOT + + 0.1-SNAPSHOT + + 0.1-SNAPSHOT + + 20081128163159 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/it0068/test.mdo b/its/core-it-suite/src/test/resources/it0068/test.mdo deleted file mode 100644 index 5bd623bf87..0000000000 --- a/its/core-it-suite/src/test/resources/it0068/test.mdo +++ /dev/null @@ -1,769 +0,0 @@ - - - - settings - Settings - - - - package - org.apache.maven.settings - - - - - TrackableBase - 1.0.0 - common base class that contains code to track the source for this instance (USER|GLOBAL) - - - 1.0.0 - - - - - - IdentifiableBase - TrackableBase - 1.0.0 - - - id - 1.0.0 - String - default - true - - - - - Settings - 1.0.0 - TrackableBase - Root element of the user configuration file. - - - localRepository - 1.0.0 - true - - String - - - interactiveMode - 1.0.0 - - boolean - true - - - usePluginRegistry - 1.0.0 - - boolean - true - - - - - offline - 1.0.0 - false - - - boolean - false - - - - - proxies - 1.0.0 - - - Proxy - * - - - - servers - 1.0.0 - - - Server - * - - - - mirrors - 1.0.0 - Configuration of download mirrors for repositories. - - - Mirror - * - - - - profiles - 1.0.0 - - - Profile - * - - - - activeProfiles - 1.0.0 - - - String - * - - - - pluginGroups - 1.0.0 - List of groupIds to search for a plugin when that plugin groupId is not explicitly provided. - - String - * - - - - - - 1.0.0 - 1 ) - { - for ( java.util.Iterator it = proxies.iterator(); it.hasNext(); ) - { - Proxy proxy = (Proxy) it.next(); - if ( proxy.isActive() ) - { - activeProxy = proxy; - break; - } - } - } - else - { - // If we only have one proxy, use it as the active one. - activeProxy = (Proxy) proxies.get( 0 ); - } - } - } - - return activeProxy; - } - - public Server getServer( String serverId ) - { - Server match = null; - - java.util.List servers = getServers(); - if ( servers != null && serverId != null ) - { - for ( java.util.Iterator it = servers.iterator(); it.hasNext(); ) - { - Server server = (Server) it.next(); - if ( serverId.equals( server.getId() ) ) - { - match = server; - break; - } - } - } - - return match; - } - - public Mirror getMirrorOf( String repositoryId ) - { - Mirror match = null; - - java.util.List mirrors = getMirrors(); - if ( mirrors != null && repositoryId != null ) - { - for ( java.util.Iterator it = mirrors.iterator(); it.hasNext(); ) - { - Mirror mirror = (Mirror) it.next(); - if ( repositoryId.equals( mirror.getMirrorOf() ) ) - { - match = mirror; - break; - } - } - } - - return match; - } - - private java.util.Map profileMap; - - public void flushProfileMap() - { - this.profileMap = null; - } - - public java.util.Map getProfilesAsMap() - { - if ( profileMap == null ) - { - profileMap = new java.util.HashMap(); - - if ( getProfiles() != null ) - { - for ( java.util.Iterator it = getProfiles().iterator(); it.hasNext(); ) - { - Profile profile = (Profile) it.next(); - - profileMap.put( profile.getId(), profile ); - } - } - } - - return profileMap; - } - - private RuntimeInfo runtimeInfo; - - public void setRuntimeInfo( RuntimeInfo runtimeInfo ) - { - this.runtimeInfo = runtimeInfo; - } - - public RuntimeInfo getRuntimeInfo() - { - return runtimeInfo; - } - ]]> - - - - - - - - Proxy - 1.0.0 - IdentifiableBase - - - active - 1.0.0 - false - false - - - boolean - - - protocol - 1.0.0 - - String - http - - - username - 1.0.0 - - String - - - password - 1.0.0 - - String - - - port - 1.0.0 - - int - - - host - 1.0.0 - - String - - - nonProxyHosts - 1.0.0 - - String - - - - - Server - 1.0.0 - IdentifiableBase - - - username - 1.0.0 - - - String - - - password - 1.0.0 - - String - - - privateKey - 1.0.0 - - - String - - - passphrase - 1.0.0 - - String - - - - - Mirror - 1.0.0 - IdentifiableBase - A download mirror for a given repository. - - - mirrorOf - true - 1.0.0 - String - The server ID of the repository being mirrored, eg - "central". This MUST NOT match the mirror id. - - - name - false - 1.0.0 - String - The optional name that describes the mirror. - - - - url - true - 1.0.0 - String - The URL of the mirror repository. - - - - - - - Profile - 1.0.0 - IdentifiableBase - - - - activation - 1.0.0 - - - Activation - - - - localRepository - 1.0.0 - String - backwards-compatible location for specifying the local repository for use in builds - THIS IS DEPRECATED: use localRepository under the root element instead. - - - properties - Extended configuration specific to this profile goes - here. - Properties - - String - * - - - - repositories - 1.0.0 - - - - Repository - * - - - - pluginRepositories - 1.0.0 - - - Repository - * - - - - - - - Activation - 1.0.0 - - - - activeByDefault - 1.0.0 - boolean - Flag specifying whether this profile is active as a default. - - - jdk - 1.0.0 - String - - - - property - 1.0.0 - - - ActivationProperty - - - - - - - - RepositoryBase - 1.0.0 - - - - id - 1.0.0 - - String - - - name - 1.0.0 - - String - - - url - 1.0.0 - - String - - - layout - 1.0.0 - The type of layout this repository uses for locating and storing artifacts - can be "legacy" or - "default". - String - default - - - - - 1.0.0 - - - - - - - Repository - RepositoryBase - 1.0.0 - - Repository contains the information needed for establishing connections with remote repoistory - - - - - snapshotPolicy - 1.0.0 - - The policy for downloading snapshots - can be "always", "daily" (default), "interval:XXX" (in minutes) or - "never" (repository is not checked, even if the snapshot is not present locally). - - String - - - - checksumPolicy - 1.0.0 - What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are - "fail" or "warn" - String - - - releases - 1.0.0 - How to handle downloading of releases from this repository - - RepositoryPolicy - - - - snapshots - 1.0.0 - How to handle downloading of snapshots from this repository - - RepositoryPolicy - - - - - - - 1.0.0 - - - - - - - RepositoryPolicy - 1.0.0 - Download policy - - - enabled - 1.0.0 - Whether to use this repository for downloading this type of artifact - boolean - true - - - updatePolicy - 1.0.0 - - The frequency for downloading updates - can be "always", "daily" (default), "interval:XXX" (in minutes) or - "never" (only if it doesn't exist locally). - - String - - - checksumPolicy - 1.0.0 - What to do when verification of an artifact checksum fails - warn, fail, etc. Valid values are - "fail" or "warn" - String - - - - - - ActivationProperty - 1.0.0 - - - - name - 1.0.0 - String - true - The name of the property to be used to activate a profile - - - value - 1.0.0 - String - The value of the property to be used to activate a profile - - - - - -