-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
316 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.mojohaus.mrm.its</groupId> | ||
<artifactId>custom-base-path</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-invoker-plugin</artifactId> | ||
<version>@maven-invoker-plugin.version@</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<localRepositoryPath>${project.build.directory}/local-repo-it</localRepositoryPath> | ||
<projectsDirectory>src/it</projectsDirectory> | ||
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo> | ||
<settingsFile>src/it/settings.xml</settingsFile> | ||
<filterProperties> | ||
<maven-compiler-plugin.version>@maven-compiler-plugin.version@</maven-compiler-plugin.version> | ||
<mrm.distribution.url>${mrm.distribution.url}</mrm.distribution.url> | ||
<mrm.repository.url>${mrm.repository.url}</mrm.repository.url> | ||
</filterProperties> | ||
<postBuildHookScript>verify</postBuildHookScript> | ||
<streamLogs>true</streamLogs> | ||
<goal>verify</goal> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>mrm-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<id>repository</id> | ||
<goals> | ||
<goal>start</goal> | ||
<goal>stop</goal> | ||
</goals> | ||
<configuration> | ||
<basePath>/foo/bar</basePath> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
1 change: 1 addition & 0 deletions
1
mrm-maven-plugin/src/it/custom-base-path/src/it/resolve/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = test |
68 changes: 68 additions & 0 deletions
68
mrm-maven-plugin/src/it/custom-base-path/src/it/resolve/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.mojohaus.mrm.hostedrepo.its</groupId> | ||
<artifactId>mrm-resolve</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit</groupId> | ||
<artifactId>junit-bom</artifactId> | ||
<version>5.8.2</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<version>5.1.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<version>3.22.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>@maven-compiler-plugin.version@</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.2</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<mrm.repository.url>@mrm.repository.url@</mrm.repository.url> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
44 changes: 44 additions & 0 deletions
44
.../it/resolve/src/test/java/org/codehaus/mojo/mrm/plugin/it/resolve/CustomBasePathTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.codehaus.mojo.mrm.plugin.it.resolve; | ||
|
||
/* | ||
* 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. | ||
*/ | ||
|
||
import org.assertj.core.api.Assertions; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.RestAssured; | ||
|
||
public class CustomBasePathTest { | ||
|
||
@Test | ||
void customBasePath() { | ||
final String mrmUri = System.getProperty("mrm.repository.url"); | ||
|
||
/* Make sure the repo ends with the base path we have set in mrm-maven-plugin/src/it/custom-base-path/pom.xml */ | ||
Assertions.assertThat(mrmUri).endsWith("foo/bar"); | ||
|
||
/* Try to download something and make sure the content is as expected */ | ||
RestAssured | ||
.get(mrmUri + "/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.pom") | ||
.then() | ||
.statusCode(200) | ||
.body(Matchers.containsString("<artifactId>commons-lang3</artifactId>"), Matchers.containsString("<version>3.12.0</version>")); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
mrm-maven-plugin/src/it/custom-base-path/src/it/resolve/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// mrm-resolve test project depends on assertj, so it should appear in the test's local repo | ||
assert new File( basedir, '../../local-repo-it/org/assertj/assertj-core/3.22.0/assertj-core-3.22.0.pom').exists() | ||
// We have downloaded commons-lang3-3.12.0.pom via mrm.repository.url from CustomBasePathTest, so it should appear in the parent local repo | ||
assert new File( basedir, '../../../../../local-repo/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.pom').exists() |
62 changes: 62 additions & 0 deletions
62
mrm-maven-plugin/src/it/custom-base-path/src/it/settings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?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. | ||
--> | ||
|
||
<settings> | ||
<mirrors> | ||
<mirror> | ||
<id>it-repo</id> | ||
<url>@mrm.repository.url@</url> | ||
<mirrorOf>*</mirrorOf> | ||
</mirror> | ||
</mirrors> | ||
<profiles> | ||
<profile> | ||
<id>it-repo</id> | ||
<repositories> | ||
<repository> | ||
<id>local.central</id> | ||
<url>http://local.central</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>local.central</id> | ||
<url>http://local.central</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
<activeProfiles> | ||
<activeProfile>it-repo</activeProfile> | ||
</activeProfiles> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
mrm-maven-plugin/src/it/hostedrepo/src/it/local-maven-repo-proxy/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = deploy |
18 changes: 18 additions & 0 deletions
18
mrm-maven-plugin/src/it/hostedrepo/src/it/local-maven-repo-proxy/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<distributionManagement> | ||
<repository> | ||
<id>mrm</id> | ||
<url>@mrm.distribution.url@</url> | ||
</repository> | ||
</distributionManagement> | ||
|
||
<groupId>org.mojohaus.mrm.hostedrepo.its</groupId> | ||
<artifactId>deploy</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>pom</packaging> | ||
|
||
</project> |
4 changes: 4 additions & 0 deletions
4
mrm-maven-plugin/src/it/hostedrepo/src/it/local-maven-repo-proxy/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
assert new File( basedir, '../../hosted-repo/org/mojohaus/mrm/hostedrepo/its/deploy/maven-metadata.xml').exists() | ||
assert new File( basedir, '../../hosted-repo/org/mojohaus/mrm/hostedrepo/its/deploy/1.0.0/deploy-1.0.0.pom').exists() | ||
assert new File( basedir, '../../hosted-repo/org/mojohaus/mrm/hostedrepo/its/deploy/1.0.0/deploy-1.0.0.pom.md5').exists() | ||
assert new File( basedir, '../../hosted-repo/org/mojohaus/mrm/hostedrepo/its/deploy/1.0.0/deploy-1.0.0.pom.sha1').exists() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.