-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(java): add support for
maven-metadata.xml
files for remote sna…
…pshot repositories. (#6950)
- Loading branch information
1 parent
2d85a00
commit 1f8fca1
Showing
7 changed files
with
231 additions
and
5 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,17 @@ | ||
package pom | ||
|
||
type Metadata struct { | ||
GroupId string `xml:"groupId"` | ||
ArtifactId string `xml:"artifactId"` | ||
Versioning Versioning `xml:"versioning"` | ||
Version string `xml:"version"` | ||
} | ||
|
||
type Versioning struct { | ||
SnapshotVersions []SnapshotVersion `xml:"snapshotVersions>snapshotVersion"` | ||
} | ||
|
||
type SnapshotVersion struct { | ||
Extension string `xml:"extension"` | ||
Value string `xml:"value"` | ||
} |
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
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
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
...ample/example-dependency/2.17.0-SNAPSHOT/example-dependency-2.17.0-20240312.035235-10.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,23 @@ | ||
<?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.example</groupId> | ||
<artifactId>example-dependency</artifactId> | ||
<version>2.17.0-SNAPSHOT</version> | ||
|
||
<packaging>jar</packaging> | ||
<name>Example API Dependency</name> | ||
<description>The example API</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>example-api</artifactId> | ||
<version>2.0.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
35 changes: 35 additions & 0 deletions
35
...pom/testdata/repository/org/example/example-dependency/2.17.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,35 @@ | ||
<metadata modelVersion="1.1.0"> | ||
<groupId>org.example</groupId> | ||
<artifactId>example-dependency</artifactId> | ||
<versioning> | ||
<lastUpdated>20240312035235</lastUpdated> | ||
<snapshot> | ||
<timestamp>20240312.035235</timestamp> | ||
<buildNumber>10</buildNumber> | ||
</snapshot> | ||
<snapshotVersions> | ||
<snapshotVersion> | ||
<classifier>sources</classifier> | ||
<extension>jar</extension> | ||
<value>2.17.0-20240312.035235-10</value> | ||
<updated>20240312035235</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>module</extension> | ||
<value>2.17.0-20240312.035235-10</value> | ||
<updated>20240312035235</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>jar</extension> | ||
<value>2.17.0-20240312.035235-10</value> | ||
<updated>20240312035235</updated> | ||
</snapshotVersion> | ||
<snapshotVersion> | ||
<extension>pom</extension> | ||
<value>2.17.0-20240312.035235-10</value> | ||
<updated>20240312035235</updated> | ||
</snapshotVersion> | ||
</snapshotVersions> | ||
</versioning> | ||
<version>2.17.0-SNAPSHOT</version> | ||
</metadata> |
20 changes: 20 additions & 0 deletions
20
pkg/dependency/parser/java/pom/testdata/snapshot/with-maven-metadata/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,20 @@ | ||
<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</groupId> | ||
<artifactId>happy</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<name>happy</name> | ||
<description>Example</description> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>example-dependency</artifactId> | ||
<version>2.17.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |