Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8084] Include repository metadata in the API #1465

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions api/maven-api-metadata/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?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.
-->
<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>
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api</artifactId>
<version>4.0.0-alpha-14-SNAPSHOT</version>
</parent>

<artifactId>maven-api-metadata</artifactId>

<name>Maven 4 API :: Repository Metadata</name>
<description>Maven 4 API - Immutable Repository Metadata model.</description>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-xml-impl</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<executions>
<execution>
<id>plugin</id>
<goals>
<goal>velocity</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<velocityBasedir>${project.basedir}/../../src/mdo</velocityBasedir>
<version>1.2.0</version>
<models>
<model>src/main/mdo/metadata.mdo</model>
</models>
<templates>
<template>model.vm</template>
</templates>
<params>
<param>packageModelV4=org.apache.maven.api.metadata</param>
</params>
</configuration>
</execution>
<execution>
<id>plugin-doc</id>
<goals>
<goal>xdoc</goal>
<goal>xsd</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<version>1.2.0</version>
<models>
<model>src/main/mdo/metadata.mdo</model>
</models>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/package-info.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// CHECKSTYLE_OFF: RegexpHeader
/**
* Maven Repository Metadata model.
*/
package org.apache.maven.api.metadata;
33 changes: 33 additions & 0 deletions api/maven-api-metadata/src/site/apt/index.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
~~ 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.

-----
Introduction
-----
Guillaume Nodet
-----
2024-04-04
-----

Maven 4 API - Repository Metadata Model

This is the immutable model for Repository Metadata in <<<org.apache.maven.api.metadata>>> package.

The following are generated from this model:

* {{{./apidocs/index.html}Java sources}} with <<<Builder>>> inner classes for immutable instances creation.

38 changes: 38 additions & 0 deletions api/maven-api-metadata/src/site/site.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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.
-->

<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd">

<edit>${project.scm.url}</edit>

<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="Javadocs" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
</menu>

<menu ref="parent"/>
<menu ref="reports"/>
</body>
</project>
1 change: 1 addition & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<module>maven-api-plugin</module>
<module>maven-api-settings</module>
<module>maven-api-toolchain</module>
<module>maven-api-metadata</module>
<module>maven-api-core</module>
<module>maven-api-spi</module>
</modules>
Expand Down
13 changes: 8 additions & 5 deletions maven-repository-metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ under the License.
<description>Per-directory local and remote repository metadata.</description>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-metadata</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
Expand All @@ -56,12 +60,12 @@ under the License.
<configuration>
<version>1.2.0</version>
<models>
<model>src/main/mdo/metadata.mdo</model>
<model>../api/maven-api-metadata/src/main/mdo/metadata.mdo</model>
</models>
<params>
<param>forcedIOModelVersion=1.1.0</param>
<param>packageModelV3=org.apache.maven.artifact.repository.metadata</param>
<param>packageModelV4=org.apache.maven.artifact.repository.metadata.v4</param>
<param>packageModelV4=org.apache.maven.api.metadata</param>
<param>packageToolV4=org.apache.maven.artifact.repository.metadata.io</param>
</params>
<velocityBasedir>${project.basedir}/../src/mdo</velocityBasedir>
Expand All @@ -75,10 +79,9 @@ under the License.
<configuration>
<version>1.2.0</version>
<models>
<model>src/main/mdo/metadata.mdo</model>
<model>../api/maven-api-metadata/src/main/mdo/metadata.mdo</model>
</models>
<templates>
<template>model.vm</template>
<template>reader-stax.vm</template>
<template>writer-stax.vm</template>
</templates>
Expand All @@ -92,7 +95,7 @@ under the License.
<configuration>
<version>1.1.0</version>
<models>
<model>src/main/mdo/metadata.mdo</model>
<model>../api/maven-api-metadata/src/main/mdo/metadata.mdo</model>
</models>
<templates>
<template>model-v3.vm</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void testRoundtrip() throws Exception {
System.setProperty(XMLInputFactory.class.getName(), WstxInputFactory.class.getName());
System.setProperty(XMLOutputFactory.class.getName(), WstxOutputFactory.class.getName());

Metadata source = new Metadata(org.apache.maven.artifact.repository.metadata.v4.Metadata.newBuilder(
Metadata source = new Metadata(org.apache.maven.api.metadata.Metadata.newBuilder(
createMetadataFromArtifact(artifact).getDelegate(), true)
.modelEncoding("UTF-16")
.build());
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ under the License.
<artifactId>maven-api-di</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-metadata</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-di</artifactId>
Expand Down