Skip to content

Commit 3712611

Browse files
Fix artifact relocation support
- Update ITs for `copy`, `unpack`, and relocation use cases. - Simplify and align artifact verification in integration tests.
1 parent e873e0e commit 3712611

25 files changed

Lines changed: 324 additions & 63 deletions

src/it/mrm/repository/ResourceArtifact-1.0.pom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
<version>1.0</version>
2828
<packaging>jar</packaging>
2929

30-
</project>
30+
</project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing,
14+
~ software distributed under the License is distributed on an
15+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
~ KIND, either express or implied. See the License for the
17+
~ specific language governing permissions and limitations
18+
~ under the License.
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
<groupId>org.apache.maven.its.dependency</groupId>
26+
<artifactId>ResourceArtifact-relocation</artifactId>
27+
<version>1.0</version>
28+
<packaging>pom</packaging>
29+
30+
<distributionManagement>
31+
<relocation>
32+
<artifactId>ResourceArtifact</artifactId>
33+
</relocation>
34+
</distributionManagement>
35+
36+
</project>
-345 Bytes
Binary file not shown.
-345 Bytes
Binary file not shown.
-345 Bytes
Binary file not shown.

src/it/projects/copy-cli/test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
artifact=org.apache.maven:maven-model:2.0.6
18+
artifact=org.apache.maven.its.dependency:a1:1.0.0
Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,4 @@
1717
* under the License.
1818
*/
1919

20-
import java.io.*;
21-
22-
File libDir = new File( basedir, "target/dependency" );
23-
24-
String[] expectedFiles = {
25-
"maven-model-2.0.6.jar",
26-
};
27-
28-
for ( String expectedFile : expectedFiles )
29-
{
30-
File file = new File( libDir, expectedFile );
31-
if ( !file.isFile() )
32-
{
33-
throw new Exception( "Missing file " + file );
34-
}
35-
}
36-
37-
return true;
20+
assert new File( basedir, 'target/dependency/a1-1.0.0.jar' ).isFile();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.goals = clean process-sources
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing,
14+
~ software distributed under the License is distributed on an
15+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
~ KIND, either express or implied. See the License for the
17+
~ specific language governing permissions and limitations
18+
~ under the License.
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.its.dependency</groupId>
27+
<artifactId>test</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
30+
<name>Test</name>
31+
<description>
32+
Test dependency:copy with relocation
33+
</description>
34+
35+
<properties>
36+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
37+
</properties>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<artifactId>maven-dependency-plugin</artifactId>
43+
<version>@project.version@</version>
44+
<executions>
45+
<execution>
46+
<id>test</id>
47+
<goals>
48+
<goal>copy</goal>
49+
</goals>
50+
<configuration>
51+
<artifactItems>
52+
<artifactItem>
53+
<groupId>org.apache.maven.its.dependency</groupId>
54+
<artifactId>ResourceArtifact-relocation</artifactId>
55+
<version>1.0</version>
56+
</artifactItem>
57+
</artifactItems>
58+
</configuration>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
assert new File( basedir, 'target/dependency/ResourceArtifact-1.0.jar' ).isFile();

0 commit comments

Comments
 (0)