Skip to content

Commit

Permalink
move repository metadata validator to dedicated module
Browse files Browse the repository at this point in the history
"maven-repository-metadata-builder"
  • Loading branch information
kwin authored and gnodet committed Sep 22, 2023
1 parent daea73c commit 40664eb
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 11 deletions.
5 changes: 5 additions & 0 deletions maven-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ under the License.
<artifactId>maven-repository-metadata</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata-builder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions maven-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ under the License.
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata-builder</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
Expand Down
60 changes: 60 additions & 0 deletions maven-repository-metadata-builder/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven</artifactId>
<version>4.0.0-alpha-8-SNAPSHOT</version>
</parent>

<artifactId>maven-repository-metadata-builder</artifactId>

<name>Maven Repository Metadata Builder</name>
<description>The repository metadata builder</description>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
</dependency>
<!-- not needed as this only contains the validators for now
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-builder-support</artifactId>
</dependency>-->

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public void validate(Metadata metadata, MetadataProblemCollector problems) {
final Level level;
if (!metadata.getPlugins().isEmpty()) {
level = Level.GROUP_ID;
}
else if ( metadata.getVersion() != null )
{
} else if (metadata.getVersion() != null) {
level = Level.VERSION;
} else {
level = Level.ARTIFACT_ID;
Expand Down
8 changes: 0 additions & 8 deletions maven-repository-metadata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ under the License.
<description>Per-directory local and remote repository metadata.</description>

<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
Expand Down Expand Up @@ -110,10 +106,6 @@ under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
4 changes: 4 additions & 0 deletions maven-resolver-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ under the License.
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata-builder</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ under the License.
<module>maven-artifact</module>
<module>maven-resolver-provider</module>
<module>maven-repository-metadata</module>
<module>maven-repository-metadata-builder</module>
<module>maven-slf4j-provider</module>
<module>maven-slf4j-wrapper</module>
<module>maven-embedder</module>
Expand Down

0 comments on commit 40664eb

Please sign in to comment.