-
Notifications
You must be signed in to change notification settings - Fork 89
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
24 changed files
with
307 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ons-functional-tests/private-artifact-repository-tests/testcode/maven-projects/.gitignore
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 @@ | ||
cwa-server |
15 changes: 15 additions & 0 deletions
15
...s/private-artifact-repository-tests/testcode/maven-projects/private-repository/.gitignore
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,15 @@ | ||
**/target | ||
**/.rewrite-cache | ||
/dependency-project/pom.xml | ||
/dependent-project/pom.xml | ||
/user.home/.config/ | ||
/user.home/apache-maven-3.9.5/ | ||
/user.home/.m2/repository | ||
/user.home/.m2/settings.xml | ||
!/user.home/.m2/settings.xml.template | ||
!/user.home/.m2/settings-security.xml | ||
/reposilite-data/static | ||
/reposilite-data/.local | ||
/reposilite-data/plugins | ||
/reposilite-data/reposilite.db | ||
/reposilite-data/configuration.cdn |
36 changes: 36 additions & 0 deletions
36
...rtifact-repository-tests/testcode/maven-projects/private-repository/README.adoc
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,36 @@ | ||
# Artifact Repository Test | ||
|
||
Test that artifacts available in a private artifact repository configured in `~/.m2/settings.xml` can be accessed. | ||
This is important as many enterprise projects use their private artifact repository to retrieve private dependencies. | ||
|
||
- A private artifact repository using (https://github.com/dzikoysk/reposilite[reposilite]) is started in a Docker container. | ||
The reposilite instance has a user configured (admin:secret) which can deploy and access artifacts. | ||
- The repositories in the artifact repository (e.g. snapshot) require successful authentication (deploy + download). | ||
- `dependency-project` has a simple class `DependencyClass` and gets deployed to the artifact repository. | ||
- `dependent-project` depends on `dependency-project` and has a class `DependentClass` that uses `DependencyClass` | ||
- `dependent-project` gets parsed | ||
- The resulting AST has the type information of `dependency-project` resolved when the repository information and credentials were read from `settings.xml` and `security-settings.xml`. | ||
Technical requirements: | ||
|
||
- The port of the Docker container is dynamic and used in settings.xml and pom.xml. | ||
- The local Maven installation of any system should not be affected by this test. | ||
- The location of the Maven dir `.m2` must therefore point to a different location while the test is running. | ||
This requires temporarily a different `.m2` location, here `testcode/maven-projects/private-repository/user.home/.m2`. | ||
When deploying the `dependency-project` the path to `settings.xml` is provided, pointing to `testcode/maven-projects/private-repository/user.home/.m2/settings.xml`. | ||
This file declares the location of the local Maven repository pointing to the same dir. | ||
Because these paths can't be relative for this test and absolute paths | ||
|
||
|
||
The `user.home` is set to point to `testcode/maven-projects/private-repository/user.home` which contains a `.m2` directory providing access configuration to the reposilite instance through `.m2/settings.xml` and `.m2/security-settings.xml`, |
25 changes: 25 additions & 0 deletions
25
...tory-tests/testcode/maven-projects/private-repository/dependency-project/pom.xml.template
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,25 @@ | ||
<?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>com.example.dependency</groupId> | ||
<artifactId>dependency-project</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>dependency-project</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<distributionManagement> | ||
<repository> | ||
<id>repository-snapshots</id> | ||
<name>Snapshots Repository</name> | ||
<url>http://localhost:${port}/snapshots</url> | ||
</repository> | ||
</distributionManagement> | ||
</project> |
13 changes: 13 additions & 0 deletions
13
...e-repository/dependency-project/src/main/java/com/example/dependency/DependencyClass.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,13 @@ | ||
package com.example.dependency; | ||
public class DependencyClass | ||
{ | ||
private String value; | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...itory-tests/testcode/maven-projects/private-repository/dependent-project/pom.xml.template
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,33 @@ | ||
<?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>com.example.dependent</groupId> | ||
<artifactId>dependent-project</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>dependent-project</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.example.dependency</groupId> | ||
<artifactId>dependency-project</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<repositories> | ||
<repository> | ||
<id>repository-snapshots</id> | ||
<name>Snapshots Repository</name> | ||
<url>http://localhost:${port}/snapshots</url> | ||
</repository> | ||
</repositories> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
...vate-repository/dependent-project/src/main/java/com/example/dependent/DependentClass.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,7 @@ | ||
package com.example.dependent; | ||
|
||
import com.example.dependency.DependencyClass; | ||
|
||
public class DependentClass { | ||
private DependencyClass dependencyClass; | ||
} |
Binary file added
BIN
+2.38 KB
...e/dependency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.jar
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...pendency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.jar.md5
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 @@ | ||
5c1fa9eb9814ca94bec1d507acb02910 |
1 change: 1 addition & 0 deletions
1
...endency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.jar.sha1
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 @@ | ||
453d6aa069f223e17d5505601a3a3a7f576d61f4 |
25 changes: 25 additions & 0 deletions
25
...e/dependency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.pom
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,25 @@ | ||
<?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>com.example.dependency</groupId> | ||
<artifactId>dependency-project</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<name>dependency-project</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<distributionManagement> | ||
<repository> | ||
<id>repository-snapshots</id> | ||
<name>Snapshots Repository</name> | ||
<url>http://localhost:52260/snapshots</url> | ||
</repository> | ||
</distributionManagement> | ||
</project> |
1 change: 1 addition & 0 deletions
1
...pendency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.pom.md5
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 @@ | ||
b5e883c0ee08ff935cf96727bb8623f4 |
1 change: 1 addition & 0 deletions
1
...endency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0-20231105.102337-1.pom.sha1
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 @@ | ||
534f31aa5ef763fe4562871d4dbb167a5cdc26f0 |
Binary file added
BIN
+2.38 KB
...apshots/com/example/dependency/dependency-project/1.0-SNAPSHOT/dependency-project-1.0.jar
Binary file not shown.
25 changes: 25 additions & 0 deletions
25
...ories/snapshots/com/example/dependency/dependency-project/1.0-SNAPSHOT/maven-metadata.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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata modelVersion="1.1.0"> | ||
<groupId>com.example.dependency</groupId> | ||
<artifactId>dependency-project</artifactId> | ||
<versioning> | ||
<lastUpdated>20231105102337</lastUpdated> | ||
<snapshot> | ||
<timestamp>20231105.102337</timestamp> | ||
<buildNumber>1</buildNumber> | ||
</snapshot> | ||
<snapshotVersions> | ||
<snapshotVersion> | ||
<extension>pom</extension> | ||
<value>1.0-20231105.102337-1</value> | ||
<updated>20231105102337</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar</extension> | ||
<value>1.0-20231105.102337-1</value> | ||
<updated>20231105102337</updated> | ||
</snapshotVersion> | ||
</snapshotVersions> | ||
</versioning> | ||
<version>1.0-SNAPSHOT</version> | ||
</metadata> |
1 change: 1 addition & 0 deletions
1
...s/snapshots/com/example/dependency/dependency-project/1.0-SNAPSHOT/maven-metadata.xml.md5
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 @@ | ||
40910b0eb66467f44ca8792bfe5a847e |
1 change: 1 addition & 0 deletions
1
.../snapshots/com/example/dependency/dependency-project/1.0-SNAPSHOT/maven-metadata.xml.sha1
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 @@ | ||
6262ab25ed0f7e2128fb26fab1acd090c535abaf |
11 changes: 11 additions & 0 deletions
11
...-data/repositories/snapshots/com/example/dependency/dependency-project/maven-metadata.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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata> | ||
<groupId>com.example.dependency</groupId> | ||
<artifactId>dependency-project</artifactId> | ||
<versioning> | ||
<versions> | ||
<version>1.0-SNAPSHOT</version> | ||
</versions> | ||
<lastUpdated>20231105102337</lastUpdated> | ||
</versioning> | ||
</metadata> |
1 change: 1 addition & 0 deletions
1
...a/repositories/snapshots/com/example/dependency/dependency-project/maven-metadata.xml.md5
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 @@ | ||
9bf1c816b6c0f8166efd71605db83682 |
1 change: 1 addition & 0 deletions
1
.../repositories/snapshots/com/example/dependency/dependency-project/maven-metadata.xml.sha1
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 @@ | ||
4fa1150761b6af92a0b232fe8ec688b9e90d0f88 |
75 changes: 75 additions & 0 deletions
75
...ests/testcode/maven-projects/private-repository/reposilite-data/shared.configuration.json
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,75 @@ | ||
{ | ||
"statistics": { | ||
"enabled": true, | ||
"resolvedRequestsInterval": "MONTHLY" | ||
}, | ||
"web": { | ||
"forwardedIp": "X-Forwarded-For" | ||
}, | ||
"frontend": { | ||
"id": "reposilite-repository", | ||
"title": "Reposilite Repository", | ||
"description": "Public Maven repository hosted through the Reposilite", | ||
"organizationWebsite": "https://reposilite.com", | ||
"organizationLogo": "https://avatars.githubusercontent.com/u/88636591", | ||
"icpLicense": "" | ||
}, | ||
"authentication": { | ||
"ldap": { | ||
"enabled": false, | ||
"ssl": false, | ||
"hostname": "ldap.domain.com", | ||
"port": 389, | ||
"baseDn": "dc=company,dc=com", | ||
"searchUserDn": "cn=reposilite,ou=admins,dc=domain,dc=com", | ||
"searchUserPassword": "reposilite-admin-secret", | ||
"typeAttribute": "person", | ||
"userAttribute": "cn", | ||
"userFilter": "(&(objectClass=person)(ou=Maven Users))", | ||
"userType": "PERSISTENT" | ||
} | ||
}, | ||
"maven": { | ||
"repositories": [ | ||
{ | ||
"id": "releases", | ||
"visibility": "PRIVATE", | ||
"redeployment": false, | ||
"preserveSnapshots": false, | ||
"storageProvider": { | ||
"type": "fs", | ||
"quota": "100%", | ||
"mount": "" | ||
}, | ||
"storagePolicy": "PRIORITIZE_UPSTREAM_METADATA", | ||
"proxied": [] | ||
}, | ||
{ | ||
"id": "snapshots", | ||
"visibility": "PRIVATE", | ||
"redeployment": true, | ||
"preserveSnapshots": false, | ||
"storageProvider": { | ||
"type": "fs", | ||
"quota": "100%", | ||
"mount": "./snapshots" | ||
}, | ||
"storagePolicy": "PRIORITIZE_UPSTREAM_METADATA", | ||
"proxied": [] | ||
}, | ||
{ | ||
"id": "private", | ||
"visibility": "PRIVATE", | ||
"redeployment": false, | ||
"preserveSnapshots": false, | ||
"storageProvider": { | ||
"type": "fs", | ||
"quota": "100%", | ||
"mount": "" | ||
}, | ||
"storagePolicy": "PRIORITIZE_UPSTREAM_METADATA", | ||
"proxied": [] | ||
} | ||
] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ests/testcode/maven-projects/private-repository/user.home/.m2/settings-clear-password.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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' | ||
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> | ||
<localRepository>/Users/fkrueger/projects/spring-boot-migrator/sbm-support-rewrite/testcode/maven-projects/private-repository/user.home/.m2/repository</localRepository> | ||
<servers> | ||
<server> | ||
<!-- must match the id in pom.xml --> | ||
<id>repository-snapshots</id> | ||
<username>user</username> | ||
<!-- password is 'secret' --> | ||
<password>secret</password> | ||
</server> | ||
</servers> | ||
</settings> |
4 changes: 4 additions & 0 deletions
4
...tory-tests/testcode/maven-projects/private-repository/user.home/.m2/settings-security.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,4 @@ | ||
<settingsSecurity> | ||
<!-- password is 'password' --> | ||
<master>{BzCEWWQMgMkHk0P8+Rr+hsscSisZT6A4+G9Mub7f/m4=}</master> | ||
</settingsSecurity> |
15 changes: 15 additions & 0 deletions
15
...tory-tests/testcode/maven-projects/private-repository/user.home/.m2/settings.xml.template
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,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' | ||
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> | ||
<localRepository>${user.home}/.m2/repository</localRepository> | ||
<servers> | ||
<server> | ||
<!-- must match the id in pom.xml --> | ||
<id>repository-snapshots</id> | ||
<username>user</username> | ||
<!-- password is 'secret' --> | ||
<password>{iKYxpFKiVu0HTAe4w0RAzev3TAav0DG8wEom2qNoRws=}</password> | ||
<!--password>secret</password--> | ||
</server> | ||
</servers> | ||
</settings> |