Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apache/maven into MPH-183_depende…
Browse files Browse the repository at this point in the history
…ncy-management-hierarchy-inputsource
  • Loading branch information
juulhobert committed Aug 13, 2024
2 parents 78b912c + 2a709dc commit 1918fdc
Show file tree
Hide file tree
Showing 132 changed files with 1,178 additions and 585 deletions.
46 changes: 4 additions & 42 deletions apache-maven/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,22 @@
Release Notes
-------------

The full list of changes can be found at https://maven.apache.org/docs/history.html.

System Requirements
-------------------

JDK:
8 or above (this is to execute Maven - it still allows you to build against 1.3
and prior JDK's).
Memory:
No minimum requirement.
Disk:
Approximately 10MB is required for the Maven installation itself. In addition to
that, additional disk space will be used for your local Maven repository. The size
of your local repository will vary depending on usage but expect at least 500MB.
Operating System:
Windows:
Windows 2000 or above.
Unix based systems (Linux, Solaris and Mac OS X) and others:
No minimum requirement.
The full list of changes, system requirements and related can be found at https://maven.apache.org/docs/history.html.

Installing Maven
----------------

1) Unpack the archive where you would like to store the binaries, e.g.:

Unix-based operating systems (Linux, Solaris and Mac OS X)
tar zxvf apache-maven-4.x.y.tar.gz
Windows
unzip apache-maven-4.x.y.zip

2) A directory called "apache-maven-4.x.y" will be created.

3) Add the bin directory to your PATH, e.g.:

Unix-based operating systems (Linux, Solaris and Mac OS X)
export PATH=/usr/local/apache-maven-4.x.y/bin:$PATH
Windows
set PATH="c:\program files\apache-maven-4.x.y\bin";%PATH%

4) Make sure JAVA_HOME is set to the location of your JDK

5) Run "mvn --version" to verify that it is correctly installed.

For complete documentation, see https://maven.apache.org/download.html#Installation
For complete documentation see https://maven.apache.org/download.html#Installation

Licensing
---------

Please see the file called LICENSE.

Maven URLs
Maven URLS
----------

Home Page: https://maven.apache.org/
Home Page: https://maven.apache.org
Downloads: https://maven.apache.org/download.html
Release Notes: https://maven.apache.org/docs/history.html
Mailing Lists: https://maven.apache.org/mailing-lists.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
*/
package org.apache.maven.api;

import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

abstract class ExtensibleEnums {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/
package org.apache.maven.api;

import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.api.annotations.Immutable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.maven.api;

import java.util.*;
import java.util.Set;

import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.api.annotations.Immutable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ private static class DefaultArtifactFactoryRequestArtifact extends BaseRequest
private final String type;
private final String coordinateString;

@SuppressWarnings("checkstyle:ParameterNumber")
DefaultArtifactFactoryRequestArtifact(
@Nonnull Session session,
String groupId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*/
package org.apache.maven.api.services;

import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.file.Path;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public DependencyResolverRequestBuilder pathTypeFilter(@Nonnull Predicate<PathTy
* @return {@code this} for method call chaining
*/
@Nonnull
public DependencyResolverRequestBuilder pathTypeFilter(@Nonnull Collection<PathType> desiredTypes) {
public DependencyResolverRequestBuilder pathTypeFilter(@Nonnull Collection<? extends PathType> desiredTypes) {
return pathTypeFilter(desiredTypes::contains);
}

Expand Down Expand Up @@ -360,6 +360,7 @@ static class DefaultDependencyResolverRequest extends BaseRequest implements Dep
* @param rootArtifact The root dependency whose transitive dependencies should be collected, may be {@code
* null}.
*/
@SuppressWarnings("checkstyle:ParameterNumber")
DefaultDependencyResolverRequest(
@Nonnull Session session,
@Nonnull RequestType requestType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@
package org.apache.maven.api.services;

import java.nio.file.Path;
import java.util.*;

import org.apache.maven.api.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import org.apache.maven.api.Artifact;
import org.apache.maven.api.Project;
import org.apache.maven.api.ProjectScope;
import org.apache.maven.api.RemoteRepository;
import org.apache.maven.api.Service;
import org.apache.maven.api.Session;
import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.api.annotations.Nonnull;
import org.apache.maven.api.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.OutputStream;
import java.io.Writer;
import java.nio.file.Path;
import java.util.function.Function;

import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.api.annotations.Nonnull;
Expand All @@ -47,6 +48,9 @@ public interface XmlWriterRequest<T> {
@Nonnull
T getContent();

@Nullable
Function<Object, String> getInputLocationFormatter();

static <T> XmlWriterRequestBuilder<T> builder() {
return new XmlWriterRequestBuilder<>();
}
Expand All @@ -56,6 +60,7 @@ class XmlWriterRequestBuilder<T> {
OutputStream outputStream;
Writer writer;
T content;
Function<Object, String> inputLocationFormatter;

public XmlWriterRequestBuilder<T> path(Path path) {
this.path = path;
Expand All @@ -77,21 +82,33 @@ public XmlWriterRequestBuilder<T> content(T content) {
return this;
}

public XmlWriterRequestBuilder<T> inputLocationFormatter(Function<Object, String> inputLocationFormatter) {
this.inputLocationFormatter = inputLocationFormatter;
return this;
}

public XmlWriterRequest<T> build() {
return new DefaultXmlWriterRequest<>(path, outputStream, writer, content);
return new DefaultXmlWriterRequest<>(path, outputStream, writer, content, inputLocationFormatter);
}

private static class DefaultXmlWriterRequest<T> implements XmlWriterRequest<T> {
final Path path;
final OutputStream outputStream;
final Writer writer;
final T content;

DefaultXmlWriterRequest(Path path, OutputStream outputStream, Writer writer, T content) {
final Function<Object, String> inputLocationFormatter;

DefaultXmlWriterRequest(
Path path,
OutputStream outputStream,
Writer writer,
T content,
Function<Object, String> inputLocationFormatter) {
this.path = path;
this.outputStream = outputStream;
this.writer = writer;
this.content = content;
this.inputLocationFormatter = inputLocationFormatter;
}

@Override
Expand All @@ -113,6 +130,11 @@ public Writer getWriter() {
public T getContent() {
return content;
}

@Override
public Function<Object, String> getInputLocationFormatter() {
return inputLocationFormatter;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({FIELD, CONSTRUCTOR, METHOD})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Qualifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({FIELD, METHOD, TYPE})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,35 @@
import org.apache.maven.api.annotations.Nonnull;
import org.apache.maven.api.annotations.Nullable;
import org.apache.maven.api.model.Repository;
import org.apache.maven.api.services.*;
import org.apache.maven.api.services.ArtifactCoordinateFactory;
import org.apache.maven.api.services.ArtifactDeployer;
import org.apache.maven.api.services.ArtifactDeployerException;
import org.apache.maven.api.services.ArtifactFactory;
import org.apache.maven.api.services.ArtifactInstaller;
import org.apache.maven.api.services.ArtifactInstallerException;
import org.apache.maven.api.services.ArtifactManager;
import org.apache.maven.api.services.ArtifactResolver;
import org.apache.maven.api.services.ArtifactResolverException;
import org.apache.maven.api.services.DependencyCoordinateFactory;
import org.apache.maven.api.services.DependencyResolver;
import org.apache.maven.api.services.DependencyResolverException;
import org.apache.maven.api.services.DependencyResolverRequest;
import org.apache.maven.api.services.LanguageRegistry;
import org.apache.maven.api.services.LocalRepositoryManager;
import org.apache.maven.api.services.Lookup;
import org.apache.maven.api.services.LookupException;
import org.apache.maven.api.services.PackagingRegistry;
import org.apache.maven.api.services.PathScopeRegistry;
import org.apache.maven.api.services.ProjectScopeRegistry;
import org.apache.maven.api.services.RepositoryFactory;
import org.apache.maven.api.services.TypeRegistry;
import org.apache.maven.api.services.VersionParser;
import org.apache.maven.api.services.VersionRangeResolver;
import org.apache.maven.api.services.VersionResolver;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.ArtifactType;

import static org.apache.maven.internal.impl.Utils.map;
import static org.apache.maven.internal.impl.Utils.nonNull;
Expand Down Expand Up @@ -257,28 +282,33 @@ private Service lookup(Class<? extends Service> c) {
}

@Nonnull
@Override
public RepositorySystemSession getSession() {
return session;
}

@Nonnull
@Override
public RepositorySystem getRepositorySystem() {
return repositorySystem;
}

@Override
public org.eclipse.aether.graph.Dependency toDependency(DependencyCoordinate dependency, boolean managed) {
org.eclipse.aether.graph.Dependency dep;
if (dependency instanceof DefaultDependencyCoordinate) {
dep = ((DefaultDependencyCoordinate) dependency).getDependency();
if (dependency instanceof AetherDependencyWrapper wrapper) {
dep = wrapper.dependency;
} else {
Type type = dependency.getType();
dep = new org.eclipse.aether.graph.Dependency(
new org.eclipse.aether.artifact.DefaultArtifact(
dependency.getGroupId(),
dependency.getArtifactId(),
dependency.getClassifier(),
dependency.getType().getExtension(),
type.getExtension(),
dependency.getVersion().toString(),
null),
Map.of("type", type.id()),
(ArtifactType) null),
dependency.getScope().id(),
dependency.getOptional(),
map(dependency.getExclusions(), this::toExclusion));
Expand Down
Loading

0 comments on commit 1918fdc

Please sign in to comment.