Skip to content

Commit

Permalink
Add a bom packaging, trim down consumer pom, add build pom
Browse files Browse the repository at this point in the history
The purpose of the BOM packaging is to more cleanly identity POM that will be consumed as BOM from POM that will be used as parents.  The BOMs can be turned into a consumer POM, whereas parents can not loose any information.
The consumer pom is flattened and trimmed down much more (parent, build, modules, properties, distributionManagement, repositories, pluginRepositories, reports, and reporting).
  • Loading branch information
gnodet committed Jul 21, 2023
1 parent 2e669bb commit adc13ea
Show file tree
Hide file tree
Showing 18 changed files with 949 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
@Immutable
public interface Repository {

/**
* The reserved id for Maven Central
*/
String CENTRAL_ID = "central";

/**
* Gets the identifier of this repository.
*
Expand Down
15 changes: 14 additions & 1 deletion api/maven-api-model/src/main/mdo/maven.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
</field>
<field xml.attribute="true" xml.tagName="root">
<name>root</name>
<version>4.0.0+</version>
<version>4.1.0+</version>
<description>
<![CDATA[
Indicates that this project is the root project, located in the upper directory of the source tree.
Expand All @@ -225,6 +225,19 @@
<type>boolean</type>
<defaultValue>false</defaultValue>
</field>
<field xml.attribute="true" xml.tagName="downgrade.model.version">
<name>downgradeModelVersion</name>
<version>4.1.0+</version>
<description>
<![CDATA[
Indicates if the build POM for this project should be downgraded to the lowest
compatible version.
<br><b>Since</b>: Maven 4.0.0
]]>
</description>
<type>boolean</type>
<defaultValue>true</defaultValue>
</field>
<field>
<name>inceptionYear</name>
<version>3.0.0+</version>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* 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.
*/
package org.apache.maven.artifact.handler.providers;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;

import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;

/**
* {@code pom} artifact handler provider.
*/
@Named("bom")
@Singleton
public class BomArtifactHandlerProvider implements Provider<ArtifactHandler> {
private final ArtifactHandler artifactHandler;

@Inject
public BomArtifactHandlerProvider() {
this.artifactHandler = new DefaultArtifactHandler("pom", null, null, null, null, false, "none", false);
}

@Override
public ArtifactHandler get() {
return artifactHandler;
}
}
Loading

0 comments on commit adc13ea

Please sign in to comment.