mirror of https://github.com/apache/maven.git
[MNG-7601] Reformat sources
This commit is contained in:
parent
49572e46c9
commit
de19cfcd2b
|
@ -1,5 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,7 +17,6 @@ KIND, either express or implied. See the License for the
|
||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -100,6 +98,19 @@ under the License.
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<id>apache.snapshots</id>
|
||||||
|
<url>https://repository.apache.org/snapshots/</url>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>${distributionFileName}</finalName>
|
<finalName>${distributionFileName}</finalName>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
|
@ -179,10 +190,10 @@ under the License.
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>create-distro-packages</id>
|
<id>create-distro-packages</id>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>single</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/bin.xml</descriptor>
|
<descriptor>src/assembly/bin.xml</descriptor>
|
||||||
|
@ -194,19 +205,6 @@ under the License.
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>apache.snapshots</id>
|
|
||||||
<url>https://repository.apache.org/snapshots/</url>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
<releases>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</releases>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>create-distribution-in-dir</id>
|
<id>create-distribution-in-dir</id>
|
||||||
|
@ -222,10 +220,10 @@ under the License.
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
<id>clean-target-dir</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>clean</goal>
|
<goal>clean</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<id>clean-target-dir</id>
|
|
||||||
<phase>prepare-package</phase>
|
<phase>prepare-package</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludeDefaultDirectories>true</excludeDefaultDirectories>
|
<excludeDefaultDirectories>true</excludeDefaultDirectories>
|
||||||
|
@ -243,10 +241,10 @@ under the License.
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>create-distribution-dir</id>
|
<id>create-distribution-dir</id>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>single</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>./</finalName>
|
<finalName>./</finalName>
|
||||||
<appendAssemblyId>false</appendAssemblyId>
|
<appendAssemblyId>false</appendAssemblyId>
|
||||||
|
@ -271,10 +269,10 @@ under the License.
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>make-src-assembly</id>
|
<id>make-src-assembly</id>
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>single</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
<descriptor>src/assembly/src.xml</descriptor>
|
<descriptor>src/assembly/src.xml</descriptor>
|
||||||
|
@ -288,14 +286,6 @@ under the License.
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.nicoulaj.maven.plugins</groupId>
|
<groupId>net.nicoulaj.maven.plugins</groupId>
|
||||||
<artifactId>checksum-maven-plugin</artifactId>
|
<artifactId>checksum-maven-plugin</artifactId>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>source-release-checksum</id>
|
|
||||||
<goals>
|
|
||||||
<goal>files</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<fileSets>
|
<fileSets>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
|
@ -310,6 +300,14 @@ under the License.
|
||||||
</fileSets>
|
</fileSets>
|
||||||
<failIfNoFiles>true</failIfNoFiles>
|
<failIfNoFiles>true</failIfNoFiles>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>source-release-checksum</id>
|
||||||
|
<goals>
|
||||||
|
<goal>files</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.settings;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,39 +16,34 @@ package org.apache.maven.settings;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.settings;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import org.apache.maven.settings.v4.SettingsXpp3Reader;
|
import org.apache.maven.settings.v4.SettingsXpp3Reader;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that the global settings.xml shipped with the distribution is in good state.
|
* Tests that the global settings.xml shipped with the distribution is in good state.
|
||||||
*
|
*
|
||||||
* @author Benjamin Bentmann
|
* @author Benjamin Bentmann
|
||||||
*/
|
*/
|
||||||
public class GlobalSettingsTest
|
public class GlobalSettingsTest {
|
||||||
{
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testValidGlobalSettings()
|
public void testValidGlobalSettings() throws Exception {
|
||||||
throws Exception
|
String basedir = System.getProperty("basedir", System.getProperty("user.dir"));
|
||||||
{
|
|
||||||
String basedir = System.getProperty( "basedir", System.getProperty( "user.dir" ) );
|
|
||||||
|
|
||||||
File globalSettingsFile = new File( basedir, "src/assembly/maven/conf/settings.xml" );
|
File globalSettingsFile = new File(basedir, "src/assembly/maven/conf/settings.xml");
|
||||||
assertTrue( globalSettingsFile.isFile(), globalSettingsFile.getAbsolutePath() );
|
assertTrue(globalSettingsFile.isFile(), globalSettingsFile.getAbsolutePath());
|
||||||
|
|
||||||
try ( Reader reader = new InputStreamReader( new FileInputStream( globalSettingsFile ), StandardCharsets.UTF_8) )
|
try (Reader reader = new InputStreamReader(new FileInputStream(globalSettingsFile), StandardCharsets.UTF_8)) {
|
||||||
{
|
new SettingsXpp3Reader().read(reader);
|
||||||
new SettingsXpp3Reader().read( reader );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -30,8 +29,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface Artifact
|
public interface Artifact {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a unique identifier for this artifact.
|
* Returns a unique identifier for this artifact.
|
||||||
|
@ -39,13 +37,15 @@ public interface Artifact
|
||||||
*
|
*
|
||||||
* @return the unique identifier
|
* @return the unique identifier
|
||||||
*/
|
*/
|
||||||
default String key()
|
default String key() {
|
||||||
{
|
|
||||||
return getGroupId()
|
return getGroupId()
|
||||||
+ ':' + getArtifactId()
|
+ ':'
|
||||||
+ ':' + getExtension()
|
+ getArtifactId()
|
||||||
+ ( getClassifier().length() > 0 ? ":" + getClassifier() : "" )
|
+ ':'
|
||||||
+ ':' + getVersion();
|
+ getExtension()
|
||||||
|
+ (getClassifier().length() > 0 ? ":" + getClassifier() : "")
|
||||||
|
+ ':'
|
||||||
|
+ getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,5 +104,4 @@ public interface Artifact
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
ArtifactCoordinate toCoordinate();
|
ArtifactCoordinate toCoordinate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -31,8 +30,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactCoordinate
|
public interface ArtifactCoordinate {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The groupId of the artifact.
|
* The groupId of the artifact.
|
||||||
|
@ -77,13 +75,11 @@ public interface ArtifactCoordinate
|
||||||
/**
|
/**
|
||||||
* Unique id identifying this artifact
|
* Unique id identifying this artifact
|
||||||
*/
|
*/
|
||||||
default String getId()
|
default String getId() {
|
||||||
{
|
|
||||||
return getGroupId()
|
return getGroupId()
|
||||||
+ ":" + getArtifactId()
|
+ ":" + getArtifactId()
|
||||||
+ ":" + getExtension()
|
+ ":" + getExtension()
|
||||||
+ ( getClassifier().isEmpty() ? "" : ":" + getClassifier() )
|
+ (getClassifier().isEmpty() ? "" : ":" + getClassifier())
|
||||||
+ ":" + getVersion();
|
+ ":" + getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,11 +16,11 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
public interface Dependency extends Artifact
|
public interface Dependency extends Artifact {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The artifact type.
|
* The artifact type.
|
||||||
|
@ -44,5 +42,4 @@ public interface Dependency extends Artifact
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
DependencyCoordinate toCoordinate();
|
DependencyCoordinate toCoordinate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,13 +16,13 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -32,8 +30,7 @@ import java.util.Collection;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface DependencyCoordinate extends ArtifactCoordinate
|
public interface DependencyCoordinate extends ArtifactCoordinate {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The type of the artifact.
|
* The type of the artifact.
|
||||||
*
|
*
|
||||||
|
@ -50,5 +47,4 @@ public interface DependencyCoordinate extends ArtifactCoordinate
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Collection<Exclusion> getExclusions();
|
Collection<Exclusion> getExclusions();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,11 +16,11 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event sent by maven during various phases of the build process.
|
* Event sent by maven during various phases of the build process.
|
||||||
|
@ -32,8 +30,7 @@ import java.util.Optional;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Event
|
public interface Event {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the type of the event.
|
* Gets the type of the event.
|
||||||
|
@ -73,5 +70,4 @@ public interface Event
|
||||||
* @return the exception or {@code empty()} if none
|
* @return the exception or {@code empty()} if none
|
||||||
*/
|
*/
|
||||||
Optional<Exception> getException();
|
Optional<Exception> getException();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,8 +26,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum EventType
|
public enum EventType {
|
||||||
{
|
|
||||||
PROJECT_DISCOVERY_STARTED,
|
PROJECT_DISCOVERY_STARTED,
|
||||||
SESSION_STARTED,
|
SESSION_STARTED,
|
||||||
SESSION_ENDED,
|
SESSION_ENDED,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
@ -29,12 +28,10 @@ import org.apache.maven.api.annotations.Nullable;
|
||||||
* @see DependencyCoordinate#getExclusions()
|
* @see DependencyCoordinate#getExclusions()
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Exclusion
|
public interface Exclusion {
|
||||||
{
|
|
||||||
@Nullable
|
@Nullable
|
||||||
String getGroupId();
|
String getGroupId();
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
String getArtifactId();
|
String getArtifactId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,9 +26,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface JavaToolchain extends Toolchain
|
public interface JavaToolchain extends Toolchain {
|
||||||
{
|
|
||||||
|
|
||||||
String getJavaHome();
|
String getJavaHome();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Consumer;
|
import org.apache.maven.api.annotations.Consumer;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -30,8 +29,8 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@FunctionalInterface @Consumer
|
@FunctionalInterface
|
||||||
public interface Listener
|
@Consumer
|
||||||
{
|
public interface Listener {
|
||||||
void onEvent( @Nonnull Event event );
|
void onEvent(@Nonnull Event event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
@ -33,10 +31,8 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface LocalRepository extends Repository
|
public interface LocalRepository extends Repository {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Path getPath();
|
Path getPath();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,8 +26,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum MetadataStorage
|
public enum MetadataStorage {
|
||||||
{
|
|
||||||
GROUP,
|
GROUP,
|
||||||
ARTIFACT,
|
ARTIFACT,
|
||||||
VERSION
|
VERSION
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,12 +16,11 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
import org.apache.maven.api.model.Plugin;
|
import org.apache.maven.api.model.Plugin;
|
||||||
import org.apache.maven.api.xml.Dom;
|
import org.apache.maven.api.xml.Dom;
|
||||||
|
|
||||||
|
@ -31,8 +28,7 @@ import org.apache.maven.api.xml.Dom;
|
||||||
* A {@code MojoExecution}
|
* A {@code MojoExecution}
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface MojoExecution
|
public interface MojoExecution {
|
||||||
{
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Plugin getPlugin();
|
Plugin getPlugin();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,15 +16,15 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a dependency node within a Maven project's dependency collector.
|
* Represents a dependency node within a Maven project's dependency collector.
|
||||||
|
@ -36,8 +34,7 @@ import java.util.stream.Stream;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface Node
|
public interface Node {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return dependency for this node
|
* @return dependency for this node
|
||||||
|
@ -70,7 +67,7 @@ public interface Node
|
||||||
* @param visitor the visitor to call back, must not be {@code null}
|
* @param visitor the visitor to call back, must not be {@code null}
|
||||||
* @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings
|
* @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings
|
||||||
*/
|
*/
|
||||||
boolean accept( @Nonnull NodeVisitor visitor );
|
boolean accept(@Nonnull NodeVisitor visitor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new tree starting at this node, filtering the children.
|
* Returns a new tree starting at this node, filtering the children.
|
||||||
|
@ -80,7 +77,7 @@ public interface Node
|
||||||
* @param filter the filter to apply
|
* @param filter the filter to apply
|
||||||
* @return a new filtered graph
|
* @return a new filtered graph
|
||||||
*/
|
*/
|
||||||
Node filter( Predicate<Node> filter );
|
Node filter(Predicate<Node> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of this dependency node.
|
* Returns a string representation of this dependency node.
|
||||||
|
@ -95,9 +92,7 @@ public interface Node
|
||||||
* @return a stream containing this node and its descendant
|
* @return a stream containing this node and its descendant
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default Stream<Node> stream()
|
default Stream<Node> stream() {
|
||||||
{
|
return Stream.concat(Stream.of(this), getChildren().stream().flatMap(Node::stream));
|
||||||
return Stream.concat( Stream.of( this ), getChildren().stream().flatMap( Node::stream ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,7 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Consumer;
|
import org.apache.maven.api.annotations.Consumer;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -26,21 +24,20 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a hierarchical visitor for collecting dependency node trees.
|
* Defines a hierarchical visitor for collecting dependency node trees.
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Consumer
|
@Consumer
|
||||||
public interface NodeVisitor
|
public interface NodeVisitor {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Starts the visit to the specified dependency node.
|
* Starts the visit to the specified dependency node.
|
||||||
*
|
*
|
||||||
* @param node the dependency node to visit
|
* @param node the dependency node to visit
|
||||||
* @return <code>true</code> to visit the specified dependency node's children, <code>false</code> to skip the
|
* @return <code>true</code> to visit the specified dependency node's children, <code>false</code> to skip the
|
||||||
* specified dependency node's children and proceed to its next sibling
|
* specified dependency node's children and proceed to its next sibling
|
||||||
*/
|
*/
|
||||||
boolean enter( @Nonnull Node node );
|
boolean enter(@Nonnull Node node);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ends the visit to the specified dependency node.
|
* Ends the visit to the specified dependency node.
|
||||||
|
@ -49,5 +46,5 @@ public interface NodeVisitor
|
||||||
* @return <code>true</code> to visit the specified dependency node's next sibling, <code>false</code> to skip the
|
* @return <code>true</code> to visit the specified dependency node's next sibling, <code>false</code> to skip the
|
||||||
* specified dependency node's next siblings and proceed to its parent
|
* specified dependency node's next siblings and proceed to its parent
|
||||||
*/
|
*/
|
||||||
boolean leave( @Nonnull Node node );
|
boolean leave(@Nonnull Node node);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,11 +16,11 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.model.Build;
|
import org.apache.maven.api.model.Build;
|
||||||
|
@ -35,8 +33,7 @@ import org.apache.maven.api.model.Model;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Project
|
public interface Project {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String getGroupId();
|
String getGroupId();
|
||||||
|
@ -57,8 +54,7 @@ public interface Project
|
||||||
Model getModel();
|
Model getModel();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default Build getBuild()
|
default Build getBuild() {
|
||||||
{
|
|
||||||
Build build = getModel().getBuild();
|
Build build = getModel().getBuild();
|
||||||
return build != null ? build : Build.newInstance();
|
return build != null ? build : Build.newInstance();
|
||||||
}
|
}
|
||||||
|
@ -74,9 +70,8 @@ public interface Project
|
||||||
Optional<Path> getPomPath();
|
Optional<Path> getPomPath();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default Optional<Path> getBasedir()
|
default Optional<Path> getBasedir() {
|
||||||
{
|
return getPomPath().map(Path::getParent);
|
||||||
return getPomPath().map( Path::getParent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -86,8 +81,7 @@ public interface Project
|
||||||
List<DependencyCoordinate> getManagedDependencies();
|
List<DependencyCoordinate> getManagedDependencies();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default String getId()
|
default String getId() {
|
||||||
{
|
|
||||||
return getModel().getId();
|
return getModel().getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,5 +95,4 @@ public interface Project
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
List<RemoteRepository> getRemotePluginRepositories();
|
List<RemoteRepository> getRemotePluginRepositories();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -28,13 +27,11 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface RemoteRepository extends Repository
|
public interface RemoteRepository extends Repository {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String getUrl();
|
String getUrl();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String getProtocol();
|
String getProtocol();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -32,8 +31,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface Repository
|
public interface Repository {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the identifier of this repository.
|
* Gets the identifier of this repository.
|
||||||
|
@ -50,5 +48,4 @@ public interface Repository
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String getType();
|
String getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -27,7 +26,6 @@ import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,65 +38,59 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum ResolutionScope
|
public enum ResolutionScope {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* empty resolution scope
|
* empty resolution scope
|
||||||
*/
|
*/
|
||||||
NONE( null ),
|
NONE(null),
|
||||||
/**
|
/**
|
||||||
* <code>compile</code> resolution scope
|
* <code>compile</code> resolution scope
|
||||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> dependencies
|
* = <code>compile</code> + <code>system</code> + <code>provided</code> dependencies
|
||||||
*/
|
*/
|
||||||
COMPILE( "compile", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED ),
|
COMPILE("compile", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED),
|
||||||
/**
|
/**
|
||||||
* <code>compile+runtime</code> resolution scope (Maven 3 only)
|
* <code>compile+runtime</code> resolution scope (Maven 3 only)
|
||||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> dependencies
|
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> dependencies
|
||||||
*/
|
*/
|
||||||
COMPILE_PLUS_RUNTIME( "compile+runtime", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED, Scope.RUNTIME ),
|
COMPILE_PLUS_RUNTIME("compile+runtime", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED, Scope.RUNTIME),
|
||||||
/**
|
/**
|
||||||
* <code>runtime</code> resolution scope
|
* <code>runtime</code> resolution scope
|
||||||
* = <code>compile</code> + <code>runtime</code> dependencies
|
* = <code>compile</code> + <code>runtime</code> dependencies
|
||||||
*/
|
*/
|
||||||
RUNTIME( "runtime", Scope.COMPILE, Scope.RUNTIME ),
|
RUNTIME("runtime", Scope.COMPILE, Scope.RUNTIME),
|
||||||
/**
|
/**
|
||||||
* <code>runtime+system</code> resolution scope (Maven 3 only)
|
* <code>runtime+system</code> resolution scope (Maven 3 only)
|
||||||
* = <code>compile</code> + <code>system</code> + <code>runtime</code> dependencies
|
* = <code>compile</code> + <code>system</code> + <code>runtime</code> dependencies
|
||||||
*/
|
*/
|
||||||
RUNTIME_PLUS_SYSTEM( "runtime+system", Scope.COMPILE, Scope.SYSTEM, Scope.RUNTIME ),
|
RUNTIME_PLUS_SYSTEM("runtime+system", Scope.COMPILE, Scope.SYSTEM, Scope.RUNTIME),
|
||||||
/**
|
/**
|
||||||
* <code>test</code> resolution scope
|
* <code>test</code> resolution scope
|
||||||
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> + <code>test</code>
|
* = <code>compile</code> + <code>system</code> + <code>provided</code> + <code>runtime</code> + <code>test</code>
|
||||||
* dependencies
|
* dependencies
|
||||||
*/
|
*/
|
||||||
TEST( "test", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED, Scope.RUNTIME, Scope.TEST );
|
TEST("test", Scope.COMPILE, Scope.SYSTEM, Scope.PROVIDED, Scope.RUNTIME, Scope.TEST);
|
||||||
|
|
||||||
private static final Map<String, ResolutionScope> VALUES
|
private static final Map<String, ResolutionScope> VALUES =
|
||||||
= Stream.of( ResolutionScope.values() ).collect( Collectors.toMap( ResolutionScope::id, s -> s ) );
|
Stream.of(ResolutionScope.values()).collect(Collectors.toMap(ResolutionScope::id, s -> s));
|
||||||
|
|
||||||
public static ResolutionScope fromString( String id )
|
public static ResolutionScope fromString(String id) {
|
||||||
{
|
return Optional.ofNullable(VALUES.get(id))
|
||||||
return Optional.ofNullable( VALUES.get( id ) )
|
.orElseThrow(() -> new IllegalArgumentException("Unknown resolution scope " + id));
|
||||||
.orElseThrow( () -> new IllegalArgumentException( "Unknown resolution scope " + id ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
private final Set<Scope> scopes;
|
private final Set<Scope> scopes;
|
||||||
|
|
||||||
ResolutionScope( String id, Scope... scopes )
|
ResolutionScope(String id, Scope... scopes) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.scopes = Collections.unmodifiableSet( new HashSet<>( Arrays.asList( scopes ) ) );
|
this.scopes = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(scopes)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String id()
|
public String id() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Scope> scopes()
|
public Set<Scope> scopes() {
|
||||||
{
|
|
||||||
return scopes;
|
return scopes;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,29 +27,25 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum Scope
|
public enum Scope {
|
||||||
{
|
COMPILE("compile"),
|
||||||
COMPILE( "compile" ),
|
PROVIDED("provided"),
|
||||||
PROVIDED ( "provided" ),
|
SYSTEM("system"),
|
||||||
SYSTEM( "system" ),
|
RUNTIME("runtime"),
|
||||||
RUNTIME( "runtime" ),
|
TEST("test"),
|
||||||
TEST( "test" ),
|
IMPORT("import");
|
||||||
IMPORT( "import" );
|
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
Scope( String id )
|
Scope(String id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String id()
|
public String id() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Scope get( String scope )
|
public static Scope get(String scope) {
|
||||||
{
|
return Enum.valueOf(Scope.class, scope.toUpperCase(Locale.ROOT));
|
||||||
return Enum.valueOf( Scope.class, scope.toUpperCase( Locale.ROOT ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.ThreadSafe;
|
import org.apache.maven.api.annotations.ThreadSafe;
|
||||||
|
@ -27,11 +26,9 @@ import org.apache.maven.api.annotations.ThreadSafe;
|
||||||
* <p>
|
* <p>
|
||||||
* Services can be retrieved from the session using the
|
* Services can be retrieved from the session using the
|
||||||
* {@link Session#getService(Class)} method.
|
* {@link Session#getService(Class)} method.
|
||||||
*
|
*
|
||||||
* @see Session#getService(Class)
|
* @see Session#getService(Class)
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@ThreadSafe
|
@ThreadSafe
|
||||||
public interface Service
|
public interface Service {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
@ -26,7 +25,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.ThreadSafe;
|
import org.apache.maven.api.annotations.ThreadSafe;
|
||||||
|
@ -41,8 +39,7 @@ import org.apache.maven.api.settings.Settings;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@ThreadSafe
|
@ThreadSafe
|
||||||
public interface Session
|
public interface Session {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Settings getSettings();
|
Settings getSettings();
|
||||||
|
@ -105,7 +102,7 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.MavenException if not called from the within a mojo execution
|
* @throws org.apache.maven.api.services.MavenException if not called from the within a mojo execution
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Map<String, Object> getPluginContext( @Nonnull Project project );
|
Map<String, Object> getPluginContext(@Nonnull Project project);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the service for the interface
|
* Retrieves the service for the interface
|
||||||
|
@ -113,7 +110,7 @@ public interface Session
|
||||||
* @throws NoSuchElementException if the service could not be found
|
* @throws NoSuchElementException if the service could not be found
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
<T extends Service> T getService( @Nonnull Class<T> clazz );
|
<T extends Service> T getService(@Nonnull Class<T> clazz);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a derived session using the given local repository.
|
* Creates a derived session using the given local repository.
|
||||||
|
@ -123,7 +120,7 @@ public interface Session
|
||||||
* @throws NullPointerException if {@code localRepository} is null
|
* @throws NullPointerException if {@code localRepository} is null
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session withLocalRepository( @Nonnull LocalRepository localRepository );
|
Session withLocalRepository(@Nonnull LocalRepository localRepository);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a derived session using the given remote repositories.
|
* Creates a derived session using the given remote repositories.
|
||||||
|
@ -133,7 +130,7 @@ public interface Session
|
||||||
* @throws NullPointerException if {@code repositories} is null
|
* @throws NullPointerException if {@code repositories} is null
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session withRemoteRepositories( @Nonnull List<RemoteRepository> repositories );
|
Session withRemoteRepositories(@Nonnull List<RemoteRepository> repositories);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the given listener which will receive all events.
|
* Register the given listener which will receive all events.
|
||||||
|
@ -141,7 +138,7 @@ public interface Session
|
||||||
* @param listener the listener to register
|
* @param listener the listener to register
|
||||||
* @throws NullPointerException if {@code listener} is null
|
* @throws NullPointerException if {@code listener} is null
|
||||||
*/
|
*/
|
||||||
void registerListener( @Nonnull Listener listener );
|
void registerListener(@Nonnull Listener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregisters a previously registered listener.
|
* Unregisters a previously registered listener.
|
||||||
|
@ -149,7 +146,7 @@ public interface Session
|
||||||
* @param listener the listener to unregister
|
* @param listener the listener to unregister
|
||||||
* @throws NullPointerException if {@code listener} is null
|
* @throws NullPointerException if {@code listener} is null
|
||||||
*/
|
*/
|
||||||
void unregisterListener( @Nonnull Listener listener );
|
void unregisterListener(@Nonnull Listener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of registered listeners.
|
* Returns the list of registered listeners.
|
||||||
|
@ -163,60 +160,60 @@ public interface Session
|
||||||
* Shortcut for <code>getService(RepositoryFactory.class).createLocal(...)</code>
|
* Shortcut for <code>getService(RepositoryFactory.class).createLocal(...)</code>
|
||||||
* @see org.apache.maven.api.services.RepositoryFactory#createLocal(Path)
|
* @see org.apache.maven.api.services.RepositoryFactory#createLocal(Path)
|
||||||
*/
|
*/
|
||||||
LocalRepository createLocalRepository( Path path );
|
LocalRepository createLocalRepository(Path path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(RepositoryFactory.class).createRemote(...)</code>
|
* Shortcut for <code>getService(RepositoryFactory.class).createRemote(...)</code>
|
||||||
* @see org.apache.maven.api.services.RepositoryFactory#createRemote(String, String)
|
* @see org.apache.maven.api.services.RepositoryFactory#createRemote(String, String)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
RemoteRepository createRemoteRepository( @Nonnull String id, @Nonnull String url );
|
RemoteRepository createRemoteRepository(@Nonnull String id, @Nonnull String url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(RepositoryFactory.class).createRemote(...)</code>
|
* Shortcut for <code>getService(RepositoryFactory.class).createRemote(...)</code>
|
||||||
* @see org.apache.maven.api.services.RepositoryFactory#createRemote(Repository)
|
* @see org.apache.maven.api.services.RepositoryFactory#createRemote(Repository)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
RemoteRepository createRemoteRepository( @Nonnull Repository repository );
|
RemoteRepository createRemoteRepository(@Nonnull Repository repository);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String)
|
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String)
|
||||||
*/
|
*/
|
||||||
ArtifactCoordinate createArtifactCoordinate( String groupId, String artifactId, String version, String extension );
|
ArtifactCoordinate createArtifactCoordinate(String groupId, String artifactId, String version, String extension);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
||||||
*/
|
*/
|
||||||
ArtifactCoordinate createArtifactCoordinate( String groupId, String artifactId, String version, String classifier,
|
ArtifactCoordinate createArtifactCoordinate(
|
||||||
String extension, String type );
|
String groupId, String artifactId, String version, String classifier, String extension, String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
||||||
*/
|
*/
|
||||||
ArtifactCoordinate createArtifactCoordinate( Artifact artifact );
|
ArtifactCoordinate createArtifactCoordinate(Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(DependencyFactory.class).create(...)</code>
|
* Shortcut for <code>getService(DependencyFactory.class).create(...)</code>
|
||||||
* @see DependencyCoordinateFactory#create(Session, ArtifactCoordinate)
|
* @see DependencyCoordinateFactory#create(Session, ArtifactCoordinate)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
DependencyCoordinate createDependencyCoordinate( @Nonnull ArtifactCoordinate coordinate );
|
DependencyCoordinate createDependencyCoordinate(@Nonnull ArtifactCoordinate coordinate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String)
|
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String)
|
||||||
*/
|
*/
|
||||||
Artifact createArtifact( String groupId, String artifactId, String version, String extension );
|
Artifact createArtifact(String groupId, String artifactId, String version, String extension);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
* Shortcut for <code>getService(ArtifactFactory.class).create(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
* @see org.apache.maven.api.services.ArtifactFactory#create(Session, String, String, String, String, String, String)
|
||||||
*/
|
*/
|
||||||
Artifact createArtifact( String groupId, String artifactId, String version, String classifier,
|
Artifact createArtifact(
|
||||||
String extension, String type );
|
String groupId, String artifactId, String version, String classifier, String extension, String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
||||||
|
@ -224,7 +221,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
||||||
*/
|
*/
|
||||||
Artifact resolveArtifact( ArtifactCoordinate coordinate );
|
Artifact resolveArtifact(ArtifactCoordinate coordinate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
||||||
|
@ -232,7 +229,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
||||||
*/
|
*/
|
||||||
Collection<Artifact> resolveArtifacts( ArtifactCoordinate... coordinates );
|
Collection<Artifact> resolveArtifacts(ArtifactCoordinate... coordinates);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
||||||
|
@ -240,7 +237,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
||||||
*/
|
*/
|
||||||
Collection<Artifact> resolveArtifacts( Collection<? extends ArtifactCoordinate> coordinates );
|
Collection<Artifact> resolveArtifacts(Collection<? extends ArtifactCoordinate> coordinates);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
||||||
|
@ -248,7 +245,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
||||||
*/
|
*/
|
||||||
Artifact resolveArtifact( Artifact artifact );
|
Artifact resolveArtifact(Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(ArtifactResolver.class).resolve(...)</code>
|
||||||
|
@ -256,7 +253,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
* @throws org.apache.maven.api.services.ArtifactResolverException if the artifact resolution failed
|
||||||
*/
|
*/
|
||||||
Collection<Artifact> resolveArtifacts( Artifact... artifacts );
|
Collection<Artifact> resolveArtifacts(Artifact... artifacts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for {@code getService(ArtifactInstaller.class).install(...)}
|
* Shortcut for {@code getService(ArtifactInstaller.class).install(...)}
|
||||||
|
@ -264,7 +261,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactInstallerException if the artifacts installation failed
|
* @throws org.apache.maven.api.services.ArtifactInstallerException if the artifacts installation failed
|
||||||
*/
|
*/
|
||||||
void installArtifacts( Artifact... artifacts );
|
void installArtifacts(Artifact... artifacts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for {@code getService(ArtifactInstaller.class).install(...)}
|
* Shortcut for {@code getService(ArtifactInstaller.class).install(...)}
|
||||||
|
@ -272,7 +269,7 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactInstallerException if the artifacts installation failed
|
* @throws org.apache.maven.api.services.ArtifactInstallerException if the artifacts installation failed
|
||||||
*/
|
*/
|
||||||
void installArtifacts( Collection<Artifact> artifacts );
|
void installArtifacts(Collection<Artifact> artifacts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactDeployer.class).deploy(...)</code>
|
* Shortcut for <code>getService(ArtifactDeployer.class).deploy(...)</code>
|
||||||
|
@ -280,26 +277,26 @@ public interface Session
|
||||||
*
|
*
|
||||||
* @throws org.apache.maven.api.services.ArtifactDeployerException if the artifacts deployment failed
|
* @throws org.apache.maven.api.services.ArtifactDeployerException if the artifacts deployment failed
|
||||||
*/
|
*/
|
||||||
void deployArtifact( RemoteRepository repository, Artifact... artifacts );
|
void deployArtifact(RemoteRepository repository, Artifact... artifacts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactManager.class).setPath(...)</code>
|
* Shortcut for <code>getService(ArtifactManager.class).setPath(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactManager#setPath(Artifact, Path)
|
* @see org.apache.maven.api.services.ArtifactManager#setPath(Artifact, Path)
|
||||||
*/
|
*/
|
||||||
void setArtifactPath( @Nonnull Artifact artifact, @Nonnull Path path );
|
void setArtifactPath(@Nonnull Artifact artifact, @Nonnull Path path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactManager.class).getPath(...)</code>
|
* Shortcut for <code>getService(ArtifactManager.class).getPath(...)</code>
|
||||||
* @see org.apache.maven.api.services.ArtifactManager#getPath(Artifact)
|
* @see org.apache.maven.api.services.ArtifactManager#getPath(Artifact)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Optional<Path> getArtifactPath( @Nonnull Artifact artifact );
|
Optional<Path> getArtifactPath(@Nonnull Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(ArtifactManager.class).isSnapshot(...)</code>
|
* Shortcut for <code>getService(ArtifactManager.class).isSnapshot(...)</code>
|
||||||
* @see org.apache.maven.api.services.VersionParser#isSnapshot(String)
|
* @see org.apache.maven.api.services.VersionParser#isSnapshot(String)
|
||||||
*/
|
*/
|
||||||
boolean isVersionSnapshot( @Nonnull String version );
|
boolean isVersionSnapshot(@Nonnull String version);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
|
* Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
|
||||||
|
@ -308,7 +305,7 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Node collectDependencies( @Nonnull Artifact artifact );
|
Node collectDependencies(@Nonnull Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
|
* Shortcut for <code>getService(DependencyCollector.class).collect(...)</code>
|
||||||
|
@ -317,7 +314,7 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Node collectDependencies( @Nonnull Project project );
|
Node collectDependencies(@Nonnull Project project);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(DependencyResolver.class).resolve(...)</code>
|
* Shortcut for <code>getService(DependencyResolver.class).resolve(...)</code>
|
||||||
|
@ -326,11 +323,11 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
* @throws org.apache.maven.api.services.DependencyCollectorException if the dependency collection failed
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Node collectDependencies( @Nonnull DependencyCoordinate dependency );
|
Node collectDependencies(@Nonnull DependencyCoordinate dependency);
|
||||||
|
|
||||||
Path getPathForLocalArtifact( @Nonnull Artifact artifact );
|
Path getPathForLocalArtifact(@Nonnull Artifact artifact);
|
||||||
|
|
||||||
Path getPathForRemoteArtifact( RemoteRepository remote, Artifact artifact );
|
Path getPathForRemoteArtifact(RemoteRepository remote, Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(VersionParser.class).parseVersion(...)</code>
|
* Shortcut for <code>getService(VersionParser.class).parseVersion(...)</code>
|
||||||
|
@ -339,7 +336,7 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.VersionParserException if the parsing failed
|
* @throws org.apache.maven.api.services.VersionParserException if the parsing failed
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Version parseVersion( @Nonnull String version );
|
Version parseVersion(@Nonnull String version);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut for <code>getService(VersionParser.class).parseVersionRange(...)</code>
|
* Shortcut for <code>getService(VersionParser.class).parseVersionRange(...)</code>
|
||||||
|
@ -348,5 +345,5 @@ public interface Session
|
||||||
* @throws org.apache.maven.api.services.VersionParserException if the parsing failed
|
* @throws org.apache.maven.api.services.VersionParserException if the parsing failed
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
VersionRange parseVersionRange( @Nonnull String versionRange );
|
VersionRange parseVersionRange(@Nonnull String versionRange);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -8,9 +6,9 @@ package org.apache.maven.api;
|
||||||
* to you under the Apache License, Version 2.0 (the
|
* to you under the Apache License, Version 2.0 (the
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@ -18,15 +16,15 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
import org.apache.maven.api.annotations.Provider;
|
import org.apache.maven.api.annotations.Provider;
|
||||||
import org.apache.maven.api.annotations.ThreadSafe;
|
import org.apache.maven.api.annotations.ThreadSafe;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A container for data that is specific to a session.
|
* A container for data that is specific to a session.
|
||||||
* All components may use this storage to associate arbitrary data with a session.
|
* All components may use this storage to associate arbitrary data with a session.
|
||||||
|
@ -35,43 +33,43 @@ import java.util.function.Supplier;
|
||||||
* abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion.
|
* abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion.
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Note:</strong> Actual implementations must be thread-safe.
|
* <strong>Note:</strong> Actual implementations must be thread-safe.
|
||||||
*
|
*
|
||||||
* @see Session#getData()
|
* @see Session#getData()
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@ThreadSafe @Provider
|
@ThreadSafe
|
||||||
public interface SessionData
|
@Provider
|
||||||
{
|
public interface SessionData {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associates the specified session data with the given key.
|
* Associates the specified session data with the given key.
|
||||||
*
|
*
|
||||||
* @param key the key under which to store the session data, must not be {@code null}
|
* @param key the key under which to store the session data, must not be {@code null}
|
||||||
* @param value the data to associate with the key, may be {@code null} to remove the mapping
|
* @param value the data to associate with the key, may be {@code null} to remove the mapping
|
||||||
*/
|
*/
|
||||||
void set( @Nonnull Object key, @Nullable Object value );
|
void set(@Nonnull Object key, @Nullable Object value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associates the specified session data with the given key if the key is currently mapped to the given value. This
|
* Associates the specified session data with the given key if the key is currently mapped to the given value. This
|
||||||
* method provides an atomic compare-and-update of some key's value.
|
* method provides an atomic compare-and-update of some key's value.
|
||||||
*
|
*
|
||||||
* @param key the key under which to store the session data, must not be {@code null}
|
* @param key the key under which to store the session data, must not be {@code null}
|
||||||
* @param oldValue the expected data currently associated with the key, may be {@code null}
|
* @param oldValue the expected data currently associated with the key, may be {@code null}
|
||||||
* @param newValue the data to associate with the key, may be {@code null} to remove the mapping
|
* @param newValue the data to associate with the key, may be {@code null} to remove the mapping
|
||||||
* @return {@code true} if the key mapping was successfully updated from the old value to the new value,
|
* @return {@code true} if the key mapping was successfully updated from the old value to the new value,
|
||||||
* {@code false} if the current key mapping didn't match the expected value and was not updated.
|
* {@code false} if the current key mapping didn't match the expected value and was not updated.
|
||||||
*/
|
*/
|
||||||
boolean set( @Nonnull Object key, @Nullable Object oldValue, @Nullable Object newValue );
|
boolean set(@Nonnull Object key, @Nullable Object oldValue, @Nullable Object newValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the session data associated with the specified key.
|
* Gets the session data associated with the specified key.
|
||||||
*
|
*
|
||||||
* @param key the key for which to retrieve the session data, must not be {@code null}
|
* @param key the key for which to retrieve the session data, must not be {@code null}
|
||||||
* @return the session data associated with the key or {@code null} if none
|
* @return the session data associated with the key or {@code null} if none
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
Object get( @Nonnull Object key );
|
Object get(@Nonnull Object key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve of compute the data associated with the specified key.
|
* Retrieve of compute the data associated with the specified key.
|
||||||
|
@ -81,6 +79,5 @@ public interface SessionData
|
||||||
* @return the session data associated with the key
|
* @return the session data associated with the key
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
Object computeIfAbsent( @Nonnull Object key, @Nonnull Supplier<Object> supplier );
|
Object computeIfAbsent(@Nonnull Object key, @Nonnull Supplier<Object> supplier);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,8 +27,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Toolchain
|
public interface Toolchain {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* get the type of toolchain.
|
* get the type of toolchain.
|
||||||
*
|
*
|
||||||
|
@ -44,7 +41,7 @@ public interface Toolchain
|
||||||
* @param toolName the tool platform independent tool name
|
* @param toolName the tool platform independent tool name
|
||||||
* @return file representing the tool executable, or null if the tool cannot be found
|
* @return file representing the tool executable, or null if the tool cannot be found
|
||||||
*/
|
*/
|
||||||
String findTool( String toolName );
|
String findTool(String toolName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let the toolchain decide if it matches requirements defined
|
* Let the toolchain decide if it matches requirements defined
|
||||||
|
@ -52,5 +49,5 @@ public interface Toolchain
|
||||||
* @param requirements Map<String, String> key value pair, may not be {@code null}
|
* @param requirements Map<String, String> key value pair, may not be {@code null}
|
||||||
* @return {@code true} if the requirements match, otherwise {@code false}
|
* @return {@code true} if the requirements match, otherwise {@code false}
|
||||||
*/
|
*/
|
||||||
boolean matchesRequirements( Map<String, String> requirements );
|
boolean matchesRequirements(Map<String, String> requirements);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -34,8 +33,7 @@ import org.apache.maven.api.annotations.Immutable;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface Type
|
public interface Type {
|
||||||
{
|
|
||||||
|
|
||||||
String POM = "pom";
|
String POM = "pom";
|
||||||
String JAR = "jar";
|
String JAR = "jar";
|
||||||
|
@ -68,5 +66,4 @@ public interface Type
|
||||||
boolean isIncludesDependencies();
|
boolean isIncludesDependencies();
|
||||||
|
|
||||||
boolean isAddedToClasspath();
|
boolean isAddedToClasspath();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
@ -30,9 +29,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @see org.apache.maven.api.Session#parseVersion(String)
|
* @see org.apache.maven.api.Session#parseVersion(String)
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Version
|
public interface Version extends Comparable<Version> {
|
||||||
extends Comparable<Version>
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO: add access to the version information
|
// TODO: add access to the version information
|
||||||
|
|
||||||
|
@ -42,5 +39,4 @@ public interface Version
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String asString();
|
String asString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
@ -28,8 +27,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface VersionRange
|
public interface VersionRange {
|
||||||
{
|
|
||||||
|
|
||||||
// TODO: add access to the version information
|
// TODO: add access to the version information
|
||||||
|
|
||||||
|
@ -39,7 +37,7 @@ public interface VersionRange
|
||||||
* @param version the version to test, must not be {@code null}
|
* @param version the version to test, must not be {@code null}
|
||||||
* @return {@code true} if this range contains the specified version, {@code false} otherwise
|
* @return {@code true} if this range contains the specified version, {@code false} otherwise
|
||||||
*/
|
*/
|
||||||
boolean contains( @Nonnull Version version );
|
boolean contains(@Nonnull Version version);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a string representation of this version range
|
* Returns a string representation of this version range
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.plugin;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@ -31,8 +30,7 @@ import java.util.function.Supplier;
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public interface Log
|
public interface Log {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return true if the <b>debug</b> error level is enabled
|
* @return true if the <b>debug</b> error level is enabled
|
||||||
*/
|
*/
|
||||||
|
@ -43,7 +41,7 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param content
|
* @param content
|
||||||
*/
|
*/
|
||||||
void debug( CharSequence content );
|
void debug(CharSequence content);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a message (and accompanying exception) to the user in the <b>debug</b> error level.<br>
|
* Send a message (and accompanying exception) to the user in the <b>debug</b> error level.<br>
|
||||||
|
@ -52,7 +50,7 @@ public interface Log
|
||||||
* @param content
|
* @param content
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void debug( CharSequence content, Throwable error );
|
void debug(CharSequence content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an exception to the user in the <b>debug</b> error level.<br>
|
* Send an exception to the user in the <b>debug</b> error level.<br>
|
||||||
|
@ -60,11 +58,11 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void debug( Throwable error );
|
void debug(Throwable error);
|
||||||
|
|
||||||
void debug( Supplier<String> content );
|
void debug(Supplier<String> content);
|
||||||
|
|
||||||
void debug( Supplier<String> content, Throwable error );
|
void debug(Supplier<String> content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the <b>info</b> error level is enabled
|
* @return true if the <b>info</b> error level is enabled
|
||||||
|
@ -76,7 +74,7 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param content
|
* @param content
|
||||||
*/
|
*/
|
||||||
void info( CharSequence content );
|
void info(CharSequence content);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a message (and accompanying exception) to the user in the <b>info</b> error level.<br>
|
* Send a message (and accompanying exception) to the user in the <b>info</b> error level.<br>
|
||||||
|
@ -85,7 +83,7 @@ public interface Log
|
||||||
* @param content
|
* @param content
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void info( CharSequence content, Throwable error );
|
void info(CharSequence content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an exception to the user in the <b>info</b> error level.<br>
|
* Send an exception to the user in the <b>info</b> error level.<br>
|
||||||
|
@ -93,11 +91,11 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void info( Throwable error );
|
void info(Throwable error);
|
||||||
|
|
||||||
void info( Supplier<String> content );
|
void info(Supplier<String> content);
|
||||||
|
|
||||||
void info( Supplier<String> content, Throwable error );
|
void info(Supplier<String> content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the <b>warn</b> error level is enabled
|
* @return true if the <b>warn</b> error level is enabled
|
||||||
|
@ -109,7 +107,7 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param content
|
* @param content
|
||||||
*/
|
*/
|
||||||
void warn( CharSequence content );
|
void warn(CharSequence content);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a message (and accompanying exception) to the user in the <b>warn</b> error level.<br>
|
* Send a message (and accompanying exception) to the user in the <b>warn</b> error level.<br>
|
||||||
|
@ -118,7 +116,7 @@ public interface Log
|
||||||
* @param content
|
* @param content
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void warn( CharSequence content, Throwable error );
|
void warn(CharSequence content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an exception to the user in the <b>warn</b> error level.<br>
|
* Send an exception to the user in the <b>warn</b> error level.<br>
|
||||||
|
@ -126,11 +124,11 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void warn( Throwable error );
|
void warn(Throwable error);
|
||||||
|
|
||||||
void warn( Supplier<String> content );
|
void warn(Supplier<String> content);
|
||||||
|
|
||||||
void warn( Supplier<String> content, Throwable error );
|
void warn(Supplier<String> content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the <b>error</b> error level is enabled
|
* @return true if the <b>error</b> error level is enabled
|
||||||
|
@ -142,7 +140,7 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param content
|
* @param content
|
||||||
*/
|
*/
|
||||||
void error( CharSequence content );
|
void error(CharSequence content);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a message (and accompanying exception) to the user in the <b>error</b> error level.<br>
|
* Send a message (and accompanying exception) to the user in the <b>error</b> error level.<br>
|
||||||
|
@ -151,7 +149,7 @@ public interface Log
|
||||||
* @param content
|
* @param content
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void error( CharSequence content, Throwable error );
|
void error(CharSequence content, Throwable error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an exception to the user in the <b>error</b> error level.<br>
|
* Send an exception to the user in the <b>error</b> error level.<br>
|
||||||
|
@ -159,10 +157,9 @@ public interface Log
|
||||||
*
|
*
|
||||||
* @param error
|
* @param error
|
||||||
*/
|
*/
|
||||||
void error( Throwable error );
|
void error(Throwable error);
|
||||||
|
|
||||||
void error( Supplier<String> content );
|
void error(Supplier<String> content);
|
||||||
|
|
||||||
void error( Supplier<String> content, Throwable error );
|
|
||||||
|
|
||||||
|
void error(Supplier<String> content, Throwable error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.plugin;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Consumer;
|
import org.apache.maven.api.annotations.Consumer;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -31,9 +30,9 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@FunctionalInterface @Consumer
|
@FunctionalInterface
|
||||||
public interface Mojo
|
@Consumer
|
||||||
{
|
public interface Mojo {
|
||||||
/**
|
/**
|
||||||
* Perform whatever build-process behavior this <code>Mojo</code> implements.<br>
|
* Perform whatever build-process behavior this <code>Mojo</code> implements.<br>
|
||||||
* This is the main trigger for the <code>Mojo</code> inside the <code>Maven</code> system, and allows
|
* This is the main trigger for the <code>Mojo</code> inside the <code>Maven</code> system, and allows
|
||||||
|
@ -42,5 +41,4 @@ public interface Mojo
|
||||||
* @throws MojoException if a problem occurs
|
* @throws MojoException if a problem occurs
|
||||||
*/
|
*/
|
||||||
void execute();
|
void execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.plugin;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.services.MavenException;
|
import org.apache.maven.api.services.MavenException;
|
||||||
|
@ -28,9 +27,7 @@ import org.apache.maven.api.services.MavenException;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class MojoException
|
public class MojoException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
protected Object source;
|
protected Object source;
|
||||||
|
|
||||||
|
@ -40,9 +37,8 @@ public class MojoException
|
||||||
* Construct a new <code>MojoException</code> exception providing the source and a short and long message:
|
* Construct a new <code>MojoException</code> exception providing the source and a short and long message:
|
||||||
* these messages are used to improve the message written at the end of Maven build.
|
* these messages are used to improve the message written at the end of Maven build.
|
||||||
*/
|
*/
|
||||||
public MojoException( Object source, String shortMessage, String longMessage )
|
public MojoException(Object source, String shortMessage, String longMessage) {
|
||||||
{
|
super(shortMessage);
|
||||||
super( shortMessage );
|
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.longMessage = longMessage;
|
this.longMessage = longMessage;
|
||||||
}
|
}
|
||||||
|
@ -51,17 +47,15 @@ public class MojoException
|
||||||
* Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Throwable</code>
|
* Construct a new <code>MojoExecutionException</code> exception wrapping an underlying <code>Throwable</code>
|
||||||
* and providing a <code>message</code>.
|
* and providing a <code>message</code>.
|
||||||
*/
|
*/
|
||||||
public MojoException( String message, Throwable cause )
|
public MojoException(String message, Throwable cause) {
|
||||||
{
|
super(message, cause);
|
||||||
super( message, cause );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a new <code>MojoExecutionException</code> exception providing a <code>message</code>.
|
* Construct a new <code>MojoExecutionException</code> exception providing a <code>message</code>.
|
||||||
*/
|
*/
|
||||||
public MojoException( String message )
|
public MojoException(String message) {
|
||||||
{
|
super(message);
|
||||||
super( message );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,19 +64,15 @@ public class MojoException
|
||||||
* @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
|
* @param cause the cause which is saved for later retrieval by the {@link #getCause()} method.
|
||||||
* A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
|
* A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.
|
||||||
*/
|
*/
|
||||||
public MojoException( Throwable cause )
|
public MojoException(Throwable cause) {
|
||||||
{
|
super(cause);
|
||||||
super( cause );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLongMessage()
|
public String getLongMessage() {
|
||||||
{
|
|
||||||
return longMessage;
|
return longMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getSource()
|
public Object getSource() {
|
||||||
{
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -25,7 +24,6 @@ import java.lang.annotation.Inherited;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,11 +35,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Documented
|
@Documented
|
||||||
@Retention( RetentionPolicy.CLASS )
|
@Retention(RetentionPolicy.CLASS)
|
||||||
@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER } )
|
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||||
@Inherited
|
@Inherited
|
||||||
public @interface Component
|
public @interface Component {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* role of the component to inject.
|
* role of the component to inject.
|
||||||
* @return the role
|
* @return the role
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -25,7 +24,6 @@ import java.lang.annotation.Inherited;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,11 +33,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Documented
|
@Documented
|
||||||
@Retention( RetentionPolicy.CLASS )
|
@Retention(RetentionPolicy.CLASS)
|
||||||
@Target( ElementType.TYPE )
|
@Target(ElementType.TYPE)
|
||||||
@Inherited
|
@Inherited
|
||||||
public @interface Execute
|
public @interface Execute {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
|
* Lifecycle phase to fork. Note that specifying a phase overrides specifying a goal.
|
||||||
* For custom lifecycle phase ids use {@link #customPhase()} instead.
|
* For custom lifecycle phase ids use {@link #customPhase()} instead.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,22 +26,19 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum InstantiationStrategy
|
public enum InstantiationStrategy {
|
||||||
{
|
PER_LOOKUP("per-lookup"),
|
||||||
PER_LOOKUP( "per-lookup" ),
|
SINGLETON("singleton"),
|
||||||
SINGLETON( "singleton" ),
|
KEEP_ALIVE("keep-alive"),
|
||||||
KEEP_ALIVE( "keep-alive" ),
|
POOLABLE("poolable");
|
||||||
POOLABLE( "poolable" );
|
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
InstantiationStrategy( String id )
|
InstantiationStrategy(String id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String id()
|
public String id() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,54 +26,49 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public enum LifecyclePhase
|
public enum LifecyclePhase {
|
||||||
{
|
VALIDATE("validate"),
|
||||||
|
INITIALIZE("initialize"),
|
||||||
|
GENERATE_SOURCES("generate-sources"),
|
||||||
|
PROCESS_SOURCES("process-sources"),
|
||||||
|
GENERATE_RESOURCES("generate-resources"),
|
||||||
|
PROCESS_RESOURCES("process-resources"),
|
||||||
|
COMPILE("compile"),
|
||||||
|
PROCESS_CLASSES("process-classes"),
|
||||||
|
GENERATE_TEST_SOURCES("generate-test-sources"),
|
||||||
|
PROCESS_TEST_SOURCES("process-test-sources"),
|
||||||
|
GENERATE_TEST_RESOURCES("generate-test-resources"),
|
||||||
|
PROCESS_TEST_RESOURCES("process-test-resources"),
|
||||||
|
TEST_COMPILE("test-compile"),
|
||||||
|
PROCESS_TEST_CLASSES("process-test-classes"),
|
||||||
|
TEST("test"),
|
||||||
|
PREPARE_PACKAGE("prepare-package"),
|
||||||
|
PACKAGE("package"),
|
||||||
|
PRE_INTEGRATION_TEST("pre-integration-test"),
|
||||||
|
INTEGRATION_TEST("integration-test"),
|
||||||
|
POST_INTEGRATION_TEST("post-integration-test"),
|
||||||
|
VERIFY("verify"),
|
||||||
|
INSTALL("install"),
|
||||||
|
DEPLOY("deploy"),
|
||||||
|
|
||||||
VALIDATE( "validate" ),
|
PRE_CLEAN("pre-clean"),
|
||||||
INITIALIZE( "initialize" ),
|
CLEAN("clean"),
|
||||||
GENERATE_SOURCES( "generate-sources" ),
|
POST_CLEAN("post-clean"),
|
||||||
PROCESS_SOURCES( "process-sources" ),
|
|
||||||
GENERATE_RESOURCES( "generate-resources" ),
|
|
||||||
PROCESS_RESOURCES( "process-resources" ),
|
|
||||||
COMPILE( "compile" ),
|
|
||||||
PROCESS_CLASSES( "process-classes" ),
|
|
||||||
GENERATE_TEST_SOURCES( "generate-test-sources" ),
|
|
||||||
PROCESS_TEST_SOURCES( "process-test-sources" ),
|
|
||||||
GENERATE_TEST_RESOURCES( "generate-test-resources" ),
|
|
||||||
PROCESS_TEST_RESOURCES( "process-test-resources" ),
|
|
||||||
TEST_COMPILE( "test-compile" ),
|
|
||||||
PROCESS_TEST_CLASSES( "process-test-classes" ),
|
|
||||||
TEST( "test" ),
|
|
||||||
PREPARE_PACKAGE( "prepare-package" ),
|
|
||||||
PACKAGE( "package" ),
|
|
||||||
PRE_INTEGRATION_TEST( "pre-integration-test" ),
|
|
||||||
INTEGRATION_TEST( "integration-test" ),
|
|
||||||
POST_INTEGRATION_TEST( "post-integration-test" ),
|
|
||||||
VERIFY( "verify" ),
|
|
||||||
INSTALL( "install" ),
|
|
||||||
DEPLOY( "deploy" ),
|
|
||||||
|
|
||||||
PRE_CLEAN( "pre-clean" ),
|
PRE_SITE("pre-site"),
|
||||||
CLEAN( "clean" ),
|
SITE("site"),
|
||||||
POST_CLEAN( "post-clean" ),
|
POST_SITE("post-site"),
|
||||||
|
SITE_DEPLOY("site-deploy"),
|
||||||
|
|
||||||
PRE_SITE( "pre-site" ),
|
NONE("");
|
||||||
SITE( "site" ),
|
|
||||||
POST_SITE( "post-site" ),
|
|
||||||
SITE_DEPLOY( "site-deploy" ),
|
|
||||||
|
|
||||||
NONE( "" );
|
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
LifecyclePhase( String id )
|
LifecyclePhase(String id) {
|
||||||
{
|
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String id()
|
public String id() {
|
||||||
{
|
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -25,7 +24,6 @@ import java.lang.annotation.Inherited;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import org.apache.maven.api.ResolutionScope;
|
import org.apache.maven.api.ResolutionScope;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -36,11 +34,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Documented
|
@Documented
|
||||||
@Retention( RetentionPolicy.CLASS )
|
@Retention(RetentionPolicy.CLASS)
|
||||||
@Target( ElementType.TYPE )
|
@Target(ElementType.TYPE)
|
||||||
@Inherited
|
@Inherited
|
||||||
public @interface Mojo
|
public @interface Mojo {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* goal name (required).
|
* goal name (required).
|
||||||
* @return the goal name
|
* @return the goal name
|
||||||
|
@ -61,7 +58,7 @@ public @interface Mojo
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the required dependency collection scope.
|
* the required dependency collection scope.
|
||||||
* @return the required dependency collection scope
|
* @return the required dependency collection scope
|
||||||
*/
|
*/
|
||||||
ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE;
|
ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE;
|
||||||
|
|
||||||
|
@ -94,5 +91,4 @@ public @interface Mojo
|
||||||
* @return the configurator bean name
|
* @return the configurator bean name
|
||||||
*/
|
*/
|
||||||
String configurator() default "";
|
String configurator() default "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.plugin.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.plugin.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.plugin.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -25,7 +24,6 @@ import java.lang.annotation.Inherited;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,11 +39,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Documented
|
@Documented
|
||||||
@Retention( RetentionPolicy.CLASS )
|
@Retention(RetentionPolicy.CLASS)
|
||||||
@Target( { ElementType.FIELD, ElementType.METHOD } )
|
@Target({ElementType.FIELD, ElementType.METHOD})
|
||||||
@Inherited
|
@Inherited
|
||||||
public @interface Parameter
|
public @interface Parameter {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* name of the bean property used to get/set the field: by default, field name is used.
|
* name of the bean property used to get/set the field: by default, field name is used.
|
||||||
* @return the name of the bean property
|
* @return the name of the bean property
|
||||||
|
@ -69,7 +66,7 @@ public @interface Parameter
|
||||||
* parameter default value, may contain <code>${...}</code> expressions which will be interpreted at
|
* parameter default value, may contain <code>${...}</code> expressions which will be interpreted at
|
||||||
* inject time: see
|
* inject time: see
|
||||||
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html">
|
* <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html">
|
||||||
* PluginParameterExpressionEvaluator</a>.
|
* PluginParameterExpressionEvaluator</a>.
|
||||||
* @return the default value
|
* @return the default value
|
||||||
*/
|
*/
|
||||||
String defaultValue() default "";
|
String defaultValue() default "";
|
||||||
|
@ -87,7 +84,7 @@ public @interface Parameter
|
||||||
* want the user to modify <code><build><finalName/></build></code> rather than specifying a value
|
* want the user to modify <code><build><finalName/></build></code> rather than specifying a value
|
||||||
* for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a
|
* for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a
|
||||||
* List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
|
* List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if the user should not be allowed to configure the parameter directly
|
* @return <code>true</code> if the user should not be allowed to configure the parameter directly
|
||||||
*/
|
*/
|
||||||
boolean readonly() default false;
|
boolean readonly() default false;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
|
@ -32,8 +31,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactCoordinateFactory extends Service
|
public interface ArtifactCoordinateFactory extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a coordinate.
|
* Creates a coordinate.
|
||||||
|
@ -43,29 +41,36 @@ public interface ArtifactCoordinateFactory extends Service
|
||||||
* @throws IllegalArgumentException if {@code request} is null or {@code request.session} is null or invalid
|
* @throws IllegalArgumentException if {@code request} is null or {@code request.session} is null or invalid
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
ArtifactCoordinate create( @Nonnull ArtifactCoordinateFactoryRequest request );
|
ArtifactCoordinate create(@Nonnull ArtifactCoordinateFactoryRequest request);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ArtifactCoordinate create( @Nonnull Session session, String groupId,
|
default ArtifactCoordinate create(
|
||||||
String artifactId, String version, String extension )
|
@Nonnull Session session, String groupId, String artifactId, String version, String extension) {
|
||||||
{
|
return create(ArtifactCoordinateFactoryRequest.build(session, groupId, artifactId, version, extension));
|
||||||
return create( ArtifactCoordinateFactoryRequest.build( session, groupId, artifactId, version, extension ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ArtifactCoordinate create( @Nonnull Session session, String groupId, String artifactId, String version,
|
default ArtifactCoordinate create(
|
||||||
String classifier, String extension, String type )
|
@Nonnull Session session,
|
||||||
{
|
String groupId,
|
||||||
return create( ArtifactCoordinateFactoryRequest.build( session, groupId, artifactId,
|
String artifactId,
|
||||||
version, classifier, extension, type ) );
|
String version,
|
||||||
|
String classifier,
|
||||||
|
String extension,
|
||||||
|
String type) {
|
||||||
|
return create(ArtifactCoordinateFactoryRequest.build(
|
||||||
|
session, groupId, artifactId, version, classifier, extension, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ArtifactCoordinate create( @Nonnull Session session, Artifact artifact )
|
default ArtifactCoordinate create(@Nonnull Session session, Artifact artifact) {
|
||||||
{
|
return create(ArtifactCoordinateFactoryRequest.build(
|
||||||
return create( ArtifactCoordinateFactoryRequest.build( session,
|
session,
|
||||||
artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion().asString(),
|
artifact.getGroupId(),
|
||||||
artifact.getClassifier(), artifact.getExtension(), null ) );
|
artifact.getArtifactId(),
|
||||||
|
artifact.getVersion().asString(),
|
||||||
|
artifact.getClassifier(),
|
||||||
|
artifact.getExtension(),
|
||||||
|
null));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
|
@ -26,8 +27,6 @@ import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request for creating a {@link ArtifactCoordinate} object.
|
* A request for creating a {@link ArtifactCoordinate} object.
|
||||||
*
|
*
|
||||||
|
@ -35,8 +34,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactCoordinateFactoryRequest
|
public interface ArtifactCoordinateFactoryRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -54,55 +52,55 @@ public interface ArtifactCoordinateFactoryRequest
|
||||||
String getType();
|
String getType();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactCoordinateFactoryRequest build( @Nonnull Session session, String groupId, String artifactId,
|
static ArtifactCoordinateFactoryRequest build(
|
||||||
String version, String extension )
|
@Nonnull Session session, String groupId, String artifactId, String version, String extension) {
|
||||||
{
|
|
||||||
return ArtifactCoordinateFactoryRequest.builder()
|
return ArtifactCoordinateFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( groupId )
|
.groupId(groupId)
|
||||||
.artifactId( artifactId )
|
.artifactId(artifactId)
|
||||||
.version( version )
|
.version(version)
|
||||||
.extension( extension )
|
.extension(extension)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactCoordinateFactoryRequest build( @Nonnull Session session, String groupId, String artifactId,
|
static ArtifactCoordinateFactoryRequest build(
|
||||||
String version, String classifier, String extension, String type )
|
@Nonnull Session session,
|
||||||
{
|
String groupId,
|
||||||
|
String artifactId,
|
||||||
|
String version,
|
||||||
|
String classifier,
|
||||||
|
String extension,
|
||||||
|
String type) {
|
||||||
return ArtifactCoordinateFactoryRequest.builder()
|
return ArtifactCoordinateFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( groupId )
|
.groupId(groupId)
|
||||||
.artifactId( artifactId )
|
.artifactId(artifactId)
|
||||||
.version( version )
|
.version(version)
|
||||||
.classifier( classifier )
|
.classifier(classifier)
|
||||||
.extension( extension )
|
.extension(extension)
|
||||||
.type( type )
|
.type(type)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactCoordinateFactoryRequest build( @Nonnull Session session, @Nonnull ArtifactCoordinate coordinate )
|
static ArtifactCoordinateFactoryRequest build(@Nonnull Session session, @Nonnull ArtifactCoordinate coordinate) {
|
||||||
{
|
|
||||||
return ArtifactCoordinateFactoryRequest.builder()
|
return ArtifactCoordinateFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( nonNull( coordinate, "coordinate cannot be null" ).getGroupId() )
|
.groupId(nonNull(coordinate, "coordinate cannot be null").getGroupId())
|
||||||
.artifactId( coordinate.getArtifactId() )
|
.artifactId(coordinate.getArtifactId())
|
||||||
.classifier( coordinate.getClassifier() )
|
.classifier(coordinate.getClassifier())
|
||||||
.version( coordinate.getVersion().asString() )
|
.version(coordinate.getVersion().asString())
|
||||||
.extension( coordinate.getExtension() )
|
.extension(coordinate.getExtension())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ArtifactFactoryRequestBuilder builder() {
|
||||||
static ArtifactFactoryRequestBuilder builder()
|
|
||||||
{
|
|
||||||
return new ArtifactFactoryRequestBuilder();
|
return new ArtifactFactoryRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ArtifactFactoryRequestBuilder
|
class ArtifactFactoryRequestBuilder {
|
||||||
{
|
|
||||||
private Session session;
|
private Session session;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
private String artifactId;
|
private String artifactId;
|
||||||
|
@ -111,61 +109,50 @@ public interface ArtifactCoordinateFactoryRequest
|
||||||
private String extension;
|
private String extension;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
ArtifactFactoryRequestBuilder()
|
ArtifactFactoryRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder session( Session session )
|
public ArtifactFactoryRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder groupId( String groupId )
|
public ArtifactFactoryRequestBuilder groupId(String groupId) {
|
||||||
{
|
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder artifactId( String artifactId )
|
public ArtifactFactoryRequestBuilder artifactId(String artifactId) {
|
||||||
{
|
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder version( String version )
|
public ArtifactFactoryRequestBuilder version(String version) {
|
||||||
{
|
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder classifier( String classifier )
|
public ArtifactFactoryRequestBuilder classifier(String classifier) {
|
||||||
{
|
|
||||||
this.classifier = classifier;
|
this.classifier = classifier;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder extension( String extension )
|
public ArtifactFactoryRequestBuilder extension(String extension) {
|
||||||
{
|
|
||||||
this.extension = extension;
|
this.extension = extension;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder type( String type )
|
public ArtifactFactoryRequestBuilder type(String type) {
|
||||||
{
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactCoordinateFactoryRequest build()
|
public ArtifactCoordinateFactoryRequest build() {
|
||||||
{
|
return new DefaultArtifactFactoryRequestArtifact(
|
||||||
return new DefaultArtifactFactoryRequestArtifact( session, groupId, artifactId, version,
|
session, groupId, artifactId, version, classifier, extension, type);
|
||||||
classifier, extension, type );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultArtifactFactoryRequestArtifact extends BaseRequest implements
|
private static class DefaultArtifactFactoryRequestArtifact extends BaseRequest
|
||||||
ArtifactCoordinateFactoryRequest
|
implements ArtifactCoordinateFactoryRequest {
|
||||||
{
|
|
||||||
private final String groupId;
|
private final String groupId;
|
||||||
private final String artifactId;
|
private final String artifactId;
|
||||||
private final String version;
|
private final String version;
|
||||||
|
@ -173,15 +160,15 @@ public interface ArtifactCoordinateFactoryRequest
|
||||||
private final String extension;
|
private final String extension;
|
||||||
private final String type;
|
private final String type;
|
||||||
|
|
||||||
DefaultArtifactFactoryRequestArtifact( @Nonnull Session session,
|
DefaultArtifactFactoryRequestArtifact(
|
||||||
String groupId,
|
@Nonnull Session session,
|
||||||
String artifactId,
|
String groupId,
|
||||||
String version,
|
String artifactId,
|
||||||
String classifier,
|
String version,
|
||||||
String extension,
|
String classifier,
|
||||||
String type )
|
String extension,
|
||||||
{
|
String type) {
|
||||||
super( session );
|
super(session);
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
@ -191,41 +178,34 @@ public interface ArtifactCoordinateFactoryRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupId()
|
public String getGroupId() {
|
||||||
{
|
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArtifactId()
|
public String getArtifactId() {
|
||||||
{
|
|
||||||
return artifactId;
|
return artifactId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersion()
|
public String getVersion() {
|
||||||
{
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getClassifier()
|
public String getClassifier() {
|
||||||
{
|
|
||||||
return classifier;
|
return classifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExtension()
|
public String getExtension() {
|
||||||
{
|
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType()
|
public String getType() {
|
||||||
{
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,13 +16,13 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.RemoteRepository;
|
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.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
|
@ -35,14 +33,13 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @see Session#deployArtifact(RemoteRepository, Artifact...)
|
* @see Session#deployArtifact(RemoteRepository, Artifact...)
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactDeployer extends Service
|
public interface ArtifactDeployer extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param request {@link ArtifactDeployerRequest}
|
* @param request {@link ArtifactDeployerRequest}
|
||||||
* @throws ArtifactDeployerException if the deployment failed
|
* @throws ArtifactDeployerException if the deployment failed
|
||||||
*/
|
*/
|
||||||
void deploy( @Nonnull ArtifactDeployerRequest request );
|
void deploy(@Nonnull ArtifactDeployerRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param session the repository session
|
* @param session the repository session
|
||||||
|
@ -51,11 +48,8 @@ public interface ArtifactDeployer extends Service
|
||||||
* @throws ArtifactDeployerException if the deployment failed
|
* @throws ArtifactDeployerException if the deployment failed
|
||||||
* @throws IllegalArgumentException if an argument is {@code null} or invalid
|
* @throws IllegalArgumentException if an argument is {@code null} or invalid
|
||||||
*/
|
*/
|
||||||
default void deploy( @Nonnull Session session,
|
default void deploy(
|
||||||
@Nonnull RemoteRepository repository,
|
@Nonnull Session session, @Nonnull RemoteRepository repository, @Nonnull Collection<Artifact> artifacts) {
|
||||||
@Nonnull Collection<Artifact> artifacts )
|
deploy(ArtifactDeployerRequest.build(session, repository, artifacts));
|
||||||
{
|
|
||||||
deploy( ArtifactDeployerRequest.build( session, repository, artifacts ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,12 +26,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ArtifactDeployerException
|
public class ArtifactDeployerException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 7421964724059077698L;
|
private static final long serialVersionUID = 7421964724059077698L;
|
||||||
|
|
||||||
|
@ -40,9 +37,7 @@ public class ArtifactDeployerException
|
||||||
* @param message the message of the error
|
* @param message the message of the error
|
||||||
* @param e {@link Exception}
|
* @param e {@link Exception}
|
||||||
*/
|
*/
|
||||||
public ArtifactDeployerException( String message, Exception e )
|
public ArtifactDeployerException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,19 +16,18 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import org.apache.maven.api.Artifact;
|
||||||
|
import org.apache.maven.api.RemoteRepository;
|
||||||
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
|
||||||
import org.apache.maven.api.RemoteRepository;
|
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request for deploying one or more artifacts to a remote repository.
|
* A request for deploying one or more artifacts to a remote repository.
|
||||||
*
|
*
|
||||||
|
@ -38,8 +35,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactDeployerRequest
|
public interface ArtifactDeployerRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -53,105 +49,88 @@ public interface ArtifactDeployerRequest
|
||||||
int getRetryFailedDeploymentCount();
|
int getRetryFailedDeploymentCount();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactDeployerRequestBuilder builder()
|
static ArtifactDeployerRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ArtifactDeployerRequestBuilder();
|
return new ArtifactDeployerRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactDeployerRequest build( @Nonnull Session session,
|
static ArtifactDeployerRequest build(
|
||||||
@Nonnull RemoteRepository repository,
|
@Nonnull Session session, @Nonnull RemoteRepository repository, @Nonnull Collection<Artifact> artifacts) {
|
||||||
@Nonnull Collection<Artifact> artifacts )
|
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.repository( nonNull( repository, "repository cannot be null" ) )
|
.repository(nonNull(repository, "repository cannot be null"))
|
||||||
.artifacts( nonNull( artifacts, "artifacts cannot be null" ) )
|
.artifacts(nonNull(artifacts, "artifacts cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ArtifactDeployerRequestBuilder
|
class ArtifactDeployerRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
RemoteRepository repository;
|
RemoteRepository repository;
|
||||||
Collection<Artifact> artifacts;
|
Collection<Artifact> artifacts;
|
||||||
int retryFailedDeploymentCount;
|
int retryFailedDeploymentCount;
|
||||||
|
|
||||||
ArtifactDeployerRequestBuilder()
|
ArtifactDeployerRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactDeployerRequestBuilder session( Session session )
|
public ArtifactDeployerRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactDeployerRequestBuilder repository( RemoteRepository repository )
|
public ArtifactDeployerRequestBuilder repository(RemoteRepository repository) {
|
||||||
{
|
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactDeployerRequestBuilder artifacts( Collection<Artifact> artifacts )
|
public ArtifactDeployerRequestBuilder artifacts(Collection<Artifact> artifacts) {
|
||||||
{
|
|
||||||
this.artifacts = artifacts;
|
this.artifacts = artifacts;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactDeployerRequestBuilder retryFailedDeploymentCount( int retryFailedDeploymentCount )
|
public ArtifactDeployerRequestBuilder retryFailedDeploymentCount(int retryFailedDeploymentCount) {
|
||||||
{
|
|
||||||
this.retryFailedDeploymentCount = retryFailedDeploymentCount;
|
this.retryFailedDeploymentCount = retryFailedDeploymentCount;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactDeployerRequest build()
|
public ArtifactDeployerRequest build() {
|
||||||
{
|
return new DefaultArtifactDeployerRequest(session, repository, artifacts, retryFailedDeploymentCount);
|
||||||
return new DefaultArtifactDeployerRequest( session, repository, artifacts, retryFailedDeploymentCount );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultArtifactDeployerRequest extends BaseRequest
|
private static class DefaultArtifactDeployerRequest extends BaseRequest implements ArtifactDeployerRequest {
|
||||||
implements ArtifactDeployerRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private final RemoteRepository repository;
|
private final RemoteRepository repository;
|
||||||
private final Collection<Artifact> artifacts;
|
private final Collection<Artifact> artifacts;
|
||||||
private final int retryFailedDeploymentCount;
|
private final int retryFailedDeploymentCount;
|
||||||
|
|
||||||
DefaultArtifactDeployerRequest( @Nonnull Session session,
|
DefaultArtifactDeployerRequest(
|
||||||
@Nonnull RemoteRepository repository,
|
@Nonnull Session session,
|
||||||
@Nonnull Collection<Artifact> artifacts,
|
@Nonnull RemoteRepository repository,
|
||||||
int retryFailedDeploymentCount )
|
@Nonnull Collection<Artifact> artifacts,
|
||||||
{
|
int retryFailedDeploymentCount) {
|
||||||
super( session );
|
super(session);
|
||||||
this.repository = nonNull( repository, "repository cannot be null" );
|
this.repository = nonNull(repository, "repository cannot be null");
|
||||||
this.artifacts = unmodifiable( nonNull( artifacts, "artifacts cannot be null" ) );
|
this.artifacts = unmodifiable(nonNull(artifacts, "artifacts cannot be null"));
|
||||||
this.retryFailedDeploymentCount = retryFailedDeploymentCount;
|
this.retryFailedDeploymentCount = retryFailedDeploymentCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public RemoteRepository getRepository()
|
public RemoteRepository getRepository() {
|
||||||
{
|
|
||||||
return repository;
|
return repository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<Artifact> getArtifacts()
|
public Collection<Artifact> getArtifacts() {
|
||||||
{
|
|
||||||
return artifacts;
|
return artifacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRetryFailedDeploymentCount()
|
public int getRetryFailedDeploymentCount() {
|
||||||
{
|
|
||||||
return retryFailedDeploymentCount;
|
return retryFailedDeploymentCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,10 +16,11 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.Artifact;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
|
@ -31,8 +30,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactFactory extends Service
|
public interface ArtifactFactory extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an artifact.
|
* Creates an artifact.
|
||||||
|
@ -42,20 +40,23 @@ public interface ArtifactFactory extends Service
|
||||||
* @throws IllegalArgumentException if {@code request} is null or {@code request.session} is null or invalid
|
* @throws IllegalArgumentException if {@code request} is null or {@code request.session} is null or invalid
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Artifact create( @Nonnull ArtifactFactoryRequest request );
|
Artifact create(@Nonnull ArtifactFactoryRequest request);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default Artifact create( @Nonnull Session session, String groupId,
|
default Artifact create(
|
||||||
String artifactId, String version, String extension )
|
@Nonnull Session session, String groupId, String artifactId, String version, String extension) {
|
||||||
{
|
return create(ArtifactFactoryRequest.build(session, groupId, artifactId, version, extension));
|
||||||
return create( ArtifactFactoryRequest.build( session, groupId, artifactId, version, extension ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default Artifact create( @Nonnull Session session, String groupId, String artifactId, String version,
|
default Artifact create(
|
||||||
String classifier, String extension, String type )
|
@Nonnull Session session,
|
||||||
{
|
String groupId,
|
||||||
return create( ArtifactFactoryRequest.build( session, groupId, artifactId,
|
String artifactId,
|
||||||
version, classifier, extension, type ) );
|
String version,
|
||||||
|
String classifier,
|
||||||
|
String extension,
|
||||||
|
String type) {
|
||||||
|
return create(ArtifactFactoryRequest.build(session, groupId, artifactId, version, classifier, extension, type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,16 +16,16 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -35,8 +33,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactFactoryRequest
|
public interface ArtifactFactoryRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -53,40 +50,42 @@ public interface ArtifactFactoryRequest
|
||||||
|
|
||||||
String getType();
|
String getType();
|
||||||
|
|
||||||
static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
|
static ArtifactFactoryRequest build(
|
||||||
String version, String extension )
|
Session session, String groupId, String artifactId, String version, String extension) {
|
||||||
{
|
|
||||||
return ArtifactFactoryRequest.builder()
|
return ArtifactFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( groupId )
|
.groupId(groupId)
|
||||||
.artifactId( artifactId )
|
.artifactId(artifactId)
|
||||||
.version( version )
|
.version(version)
|
||||||
.extension( extension )
|
.extension(extension)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
static ArtifactFactoryRequest build( Session session, String groupId, String artifactId,
|
static ArtifactFactoryRequest build(
|
||||||
String version, String classifier, String extension, String type )
|
Session session,
|
||||||
{
|
String groupId,
|
||||||
|
String artifactId,
|
||||||
|
String version,
|
||||||
|
String classifier,
|
||||||
|
String extension,
|
||||||
|
String type) {
|
||||||
return ArtifactFactoryRequest.builder()
|
return ArtifactFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( groupId )
|
.groupId(groupId)
|
||||||
.artifactId( artifactId )
|
.artifactId(artifactId)
|
||||||
.version( version )
|
.version(version)
|
||||||
.classifier( classifier )
|
.classifier(classifier)
|
||||||
.extension( extension )
|
.extension(extension)
|
||||||
.type( type )
|
.type(type)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
static ArtifactFactoryRequestBuilder builder()
|
static ArtifactFactoryRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ArtifactFactoryRequestBuilder();
|
return new ArtifactFactoryRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ArtifactFactoryRequestBuilder
|
class ArtifactFactoryRequestBuilder {
|
||||||
{
|
|
||||||
private Session session;
|
private Session session;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
private String artifactId;
|
private String artifactId;
|
||||||
|
@ -95,60 +94,49 @@ public interface ArtifactFactoryRequest
|
||||||
private String extension;
|
private String extension;
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
ArtifactFactoryRequestBuilder()
|
ArtifactFactoryRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder session( Session session )
|
public ArtifactFactoryRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder groupId( String groupId )
|
public ArtifactFactoryRequestBuilder groupId(String groupId) {
|
||||||
{
|
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder artifactId( String artifactId )
|
public ArtifactFactoryRequestBuilder artifactId(String artifactId) {
|
||||||
{
|
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder version( String version )
|
public ArtifactFactoryRequestBuilder version(String version) {
|
||||||
{
|
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder classifier( String classifier )
|
public ArtifactFactoryRequestBuilder classifier(String classifier) {
|
||||||
{
|
|
||||||
this.classifier = classifier;
|
this.classifier = classifier;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder extension( String extension )
|
public ArtifactFactoryRequestBuilder extension(String extension) {
|
||||||
{
|
|
||||||
this.extension = extension;
|
this.extension = extension;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequestBuilder type( String type )
|
public ArtifactFactoryRequestBuilder type(String type) {
|
||||||
{
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtifactFactoryRequest build()
|
public ArtifactFactoryRequest build() {
|
||||||
{
|
return new DefaultArtifactFactoryRequest(
|
||||||
return new DefaultArtifactFactoryRequest( session, groupId, artifactId, version,
|
session, groupId, artifactId, version, classifier, extension, type);
|
||||||
classifier, extension, type );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultArtifactFactoryRequest extends BaseRequest implements ArtifactFactoryRequest
|
private static class DefaultArtifactFactoryRequest extends BaseRequest implements ArtifactFactoryRequest {
|
||||||
{
|
|
||||||
private final String groupId;
|
private final String groupId;
|
||||||
private final String artifactId;
|
private final String artifactId;
|
||||||
private final String version;
|
private final String version;
|
||||||
|
@ -156,15 +144,15 @@ public interface ArtifactFactoryRequest
|
||||||
private final String extension;
|
private final String extension;
|
||||||
private final String type;
|
private final String type;
|
||||||
|
|
||||||
DefaultArtifactFactoryRequest( @Nonnull Session session,
|
DefaultArtifactFactoryRequest(
|
||||||
String groupId,
|
@Nonnull Session session,
|
||||||
String artifactId,
|
String groupId,
|
||||||
String version,
|
String artifactId,
|
||||||
String classifier,
|
String version,
|
||||||
String extension,
|
String classifier,
|
||||||
String type )
|
String extension,
|
||||||
{
|
String type) {
|
||||||
super( session );
|
super(session);
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
@ -174,41 +162,34 @@ public interface ArtifactFactoryRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupId()
|
public String getGroupId() {
|
||||||
{
|
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArtifactId()
|
public String getArtifactId() {
|
||||||
{
|
|
||||||
return artifactId;
|
return artifactId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersion()
|
public String getVersion() {
|
||||||
{
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getClassifier()
|
public String getClassifier() {
|
||||||
{
|
|
||||||
return classifier;
|
return classifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExtension()
|
public String getExtension() {
|
||||||
{
|
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType()
|
public String getType() {
|
||||||
{
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,13 +16,13 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.Artifact;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,14 +32,13 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @see Session#withLocalRepository(org.apache.maven.api.LocalRepository)
|
* @see Session#withLocalRepository(org.apache.maven.api.LocalRepository)
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactInstaller extends Service
|
public interface ArtifactInstaller extends Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param request {@link ArtifactInstallerRequest}
|
* @param request {@link ArtifactInstallerRequest}
|
||||||
* @throws ArtifactInstallerException in case of an error
|
* @throws ArtifactInstallerException in case of an error
|
||||||
* @throws IllegalArgumentException in case {@code request} is {@code null}
|
* @throws IllegalArgumentException in case {@code request} is {@code null}
|
||||||
*/
|
*/
|
||||||
void install( ArtifactInstallerRequest request );
|
void install(ArtifactInstallerRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param session the repository session
|
* @param session the repository session
|
||||||
|
@ -51,9 +48,8 @@ public interface ArtifactInstaller extends Service
|
||||||
* @throws IllegalArgumentException in case of parameter {@code session} is {@code null} or
|
* @throws IllegalArgumentException in case of parameter {@code session} is {@code null} or
|
||||||
* {@code artifact} is {@code null}.
|
* {@code artifact} is {@code null}.
|
||||||
*/
|
*/
|
||||||
default void install( Session session, Artifact artifact )
|
default void install(Session session, Artifact artifact) {
|
||||||
{
|
install(session, Collections.singletonList(artifact));
|
||||||
install( session, Collections.singletonList( artifact ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,9 +62,7 @@ public interface ArtifactInstaller extends Service
|
||||||
* or parameter {@code mavenArtifacts} is {@code null} or
|
* or parameter {@code mavenArtifacts} is {@code null} or
|
||||||
* {@code mavenArtifacts.isEmpty()} is {@code true}.
|
* {@code mavenArtifacts.isEmpty()} is {@code true}.
|
||||||
*/
|
*/
|
||||||
default void install( Session session, Collection<Artifact> artifacts )
|
default void install(Session session, Collection<Artifact> artifacts) {
|
||||||
{
|
install(ArtifactInstallerRequest.build(session, artifacts));
|
||||||
install( ArtifactInstallerRequest.build( session, artifacts ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -25,12 +24,10 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ArtifactInstallerException
|
public class ArtifactInstallerException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 3652561971360586373L;
|
private static final long serialVersionUID = 3652561971360586373L;
|
||||||
|
|
||||||
|
@ -38,9 +35,7 @@ public class ArtifactInstallerException
|
||||||
* @param message the message of the error
|
* @param message the message of the error
|
||||||
* @param e {@link Exception}
|
* @param e {@link Exception}
|
||||||
*/
|
*/
|
||||||
public ArtifactInstallerException( String message, Exception e )
|
public ArtifactInstallerException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,21 +16,20 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import org.apache.maven.api.Artifact;
|
||||||
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request for installing one or more artifacts in the local repository.
|
* A request for installing one or more artifacts in the local repository.
|
||||||
*
|
*
|
||||||
|
@ -40,8 +37,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactInstallerRequest
|
public interface ArtifactInstallerRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -50,70 +46,56 @@ public interface ArtifactInstallerRequest
|
||||||
Collection<Artifact> getArtifacts();
|
Collection<Artifact> getArtifacts();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactInstallerRequestBuilder builder()
|
static ArtifactInstallerRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ArtifactInstallerRequestBuilder();
|
return new ArtifactInstallerRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactInstallerRequest build( Session session, Collection<Artifact> artifacts )
|
static ArtifactInstallerRequest build(Session session, Collection<Artifact> artifacts) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.artifacts( nonNull( artifacts, "artifacts cannot be null" ) )
|
.artifacts(nonNull(artifacts, "artifacts cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ArtifactInstallerRequestBuilder
|
class ArtifactInstallerRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
Collection<Artifact> artifacts = Collections.emptyList();
|
Collection<Artifact> artifacts = Collections.emptyList();
|
||||||
|
|
||||||
ArtifactInstallerRequestBuilder()
|
ArtifactInstallerRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactInstallerRequestBuilder session( @Nonnull Session session )
|
public ArtifactInstallerRequestBuilder session(@Nonnull Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactInstallerRequestBuilder artifacts( @Nullable Collection<Artifact> artifacts )
|
public ArtifactInstallerRequestBuilder artifacts(@Nullable Collection<Artifact> artifacts) {
|
||||||
{
|
|
||||||
this.artifacts = artifacts != null ? artifacts : Collections.emptyList();
|
this.artifacts = artifacts != null ? artifacts : Collections.emptyList();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactInstallerRequest build()
|
public ArtifactInstallerRequest build() {
|
||||||
{
|
return new DefaultArtifactInstallerRequest(session, artifacts);
|
||||||
return new DefaultArtifactInstallerRequest( session, artifacts );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class DefaultArtifactInstallerRequest extends BaseRequest
|
static class DefaultArtifactInstallerRequest extends BaseRequest implements ArtifactInstallerRequest {
|
||||||
implements ArtifactInstallerRequest
|
|
||||||
{
|
|
||||||
|
|
||||||
private final Collection<Artifact> artifacts;
|
private final Collection<Artifact> artifacts;
|
||||||
|
|
||||||
DefaultArtifactInstallerRequest( @Nonnull Session session,
|
DefaultArtifactInstallerRequest(@Nonnull Session session, @Nonnull Collection<Artifact> artifacts) {
|
||||||
@Nonnull Collection<Artifact> artifacts )
|
super(session);
|
||||||
{
|
this.artifacts = unmodifiable(nonNull(artifacts, "artifacts cannot be null"));
|
||||||
super( session );
|
|
||||||
this.artifacts = unmodifiable( nonNull( artifacts, "artifacts cannot be null" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<Artifact> getArtifacts()
|
public Collection<Artifact> getArtifacts() {
|
||||||
{
|
|
||||||
return artifacts;
|
return artifacts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,34 +16,31 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
|
import org.apache.maven.api.Service;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactManager extends Service
|
public interface ArtifactManager extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the path of the file previously associated to this artifact
|
* Returns the path of the file previously associated to this artifact
|
||||||
* or {@code Optional.empty()} if no path has been associated.
|
* or {@code Optional.empty()} if no path has been associated.
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Optional<Path> getPath( @Nonnull Artifact artifact );
|
Optional<Path> getPath(@Nonnull Artifact artifact);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associates the given file path to the artifact.
|
* Associates the given file path to the artifact.
|
||||||
*/
|
*/
|
||||||
void setPath( @Nonnull Artifact artifact, Path path );
|
void setPath(@Nonnull Artifact artifact, Path path);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
|
@ -32,8 +30,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactResolver extends Service
|
public interface ArtifactResolver extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param request {@link ArtifactResolverRequest}
|
* @param request {@link ArtifactResolverRequest}
|
||||||
|
@ -42,7 +39,7 @@ public interface ArtifactResolver extends Service
|
||||||
* @throws IllegalArgumentException in case of parameter {@code buildingRequest} is {@code null} or
|
* @throws IllegalArgumentException in case of parameter {@code buildingRequest} is {@code null} or
|
||||||
* parameter {@code mavenArtifact} is {@code null} or invalid
|
* parameter {@code mavenArtifact} is {@code null} or invalid
|
||||||
*/
|
*/
|
||||||
ArtifactResolverResult resolve( ArtifactResolverRequest request );
|
ArtifactResolverResult resolve(ArtifactResolverRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param session {@link Session}
|
* @param session {@link Session}
|
||||||
|
@ -52,10 +49,7 @@ public interface ArtifactResolver extends Service
|
||||||
* @throws IllegalArgumentException in case of parameter {@code buildingRequest} is {@code null} or
|
* @throws IllegalArgumentException in case of parameter {@code buildingRequest} is {@code null} or
|
||||||
* parameter {@code coordinate} is {@code null} or invalid
|
* parameter {@code coordinate} is {@code null} or invalid
|
||||||
*/
|
*/
|
||||||
default ArtifactResolverResult resolve( Session session,
|
default ArtifactResolverResult resolve(Session session, Collection<? extends ArtifactCoordinate> coordinates) {
|
||||||
Collection<? extends ArtifactCoordinate> coordinates )
|
return resolve(ArtifactResolverRequest.build(session, coordinates));
|
||||||
{
|
|
||||||
return resolve( ArtifactResolverRequest.build( session, coordinates ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,9 +26,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ArtifactResolverException
|
public class ArtifactResolverException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 7252294837746943917L;
|
private static final long serialVersionUID = 7252294837746943917L;
|
||||||
|
|
||||||
|
@ -37,9 +34,7 @@ public class ArtifactResolverException
|
||||||
* @param message the message for the exception
|
* @param message the message for the exception
|
||||||
* @param e the exception itself
|
* @param e the exception itself
|
||||||
*/
|
*/
|
||||||
public ArtifactResolverException( String message, Exception e )
|
public ArtifactResolverException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,11 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -28,8 +28,6 @@ import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request for resolving an artifact.
|
* A request for resolving an artifact.
|
||||||
*
|
*
|
||||||
|
@ -37,8 +35,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ArtifactResolverRequest
|
public interface ArtifactResolverRequest {
|
||||||
{
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
|
||||||
|
@ -46,70 +43,58 @@ public interface ArtifactResolverRequest
|
||||||
Collection<? extends ArtifactCoordinate> getCoordinates();
|
Collection<? extends ArtifactCoordinate> getCoordinates();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactResolverRequestBuilder builder()
|
static ArtifactResolverRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ArtifactResolverRequestBuilder();
|
return new ArtifactResolverRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ArtifactResolverRequest build( @Nonnull Session session,
|
static ArtifactResolverRequest build(
|
||||||
@Nonnull Collection<? extends ArtifactCoordinate> coordinates )
|
@Nonnull Session session, @Nonnull Collection<? extends ArtifactCoordinate> coordinates) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.coordinates( nonNull( coordinates, "coordinates cannot be null" ) )
|
.coordinates(nonNull(coordinates, "coordinates cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ArtifactResolverRequestBuilder
|
class ArtifactResolverRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
Collection<? extends ArtifactCoordinate> coordinates;
|
Collection<? extends ArtifactCoordinate> coordinates;
|
||||||
|
|
||||||
ArtifactResolverRequestBuilder()
|
ArtifactResolverRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactResolverRequestBuilder session( Session session )
|
public ArtifactResolverRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactResolverRequestBuilder coordinates( Collection<? extends ArtifactCoordinate> coordinates )
|
public ArtifactResolverRequestBuilder coordinates(Collection<? extends ArtifactCoordinate> coordinates) {
|
||||||
{
|
|
||||||
this.coordinates = coordinates;
|
this.coordinates = coordinates;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public ArtifactResolverRequest build()
|
public ArtifactResolverRequest build() {
|
||||||
{
|
return new DefaultArtifactResolverRequest(session, coordinates);
|
||||||
return new DefaultArtifactResolverRequest( session, coordinates );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultArtifactResolverRequest extends BaseRequest implements ArtifactResolverRequest
|
private static class DefaultArtifactResolverRequest extends BaseRequest implements ArtifactResolverRequest {
|
||||||
{
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private final Collection<? extends ArtifactCoordinate> coordinates;
|
private final Collection<? extends ArtifactCoordinate> coordinates;
|
||||||
|
|
||||||
DefaultArtifactResolverRequest( @Nonnull Session session,
|
DefaultArtifactResolverRequest(
|
||||||
@Nonnull Collection<? extends ArtifactCoordinate> coordinates )
|
@Nonnull Session session, @Nonnull Collection<? extends ArtifactCoordinate> coordinates) {
|
||||||
{
|
super(session);
|
||||||
super( session );
|
this.coordinates = unmodifiable(nonNull(coordinates, "coordinates cannot be null"));
|
||||||
this.coordinates = unmodifiable( nonNull( coordinates, "coordinates cannot be null" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<? extends ArtifactCoordinate> getCoordinates()
|
public Collection<? extends ArtifactCoordinate> getCoordinates() {
|
||||||
{
|
|
||||||
return coordinates;
|
return coordinates;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,26 +16,24 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Artifact Result
|
* The Artifact Result
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ArtifactResolverResult
|
public interface ArtifactResolverResult {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return {@link Artifact}
|
* @return {@link Artifact}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Map<Artifact, Path> getArtifacts();
|
Map<Artifact, Path> getArtifacts();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,15 +16,14 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for requests.
|
* Base class for requests.
|
||||||
|
@ -34,34 +31,29 @@ import org.apache.maven.api.Session;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
abstract class BaseRequest
|
abstract class BaseRequest {
|
||||||
{
|
|
||||||
|
|
||||||
private final Session session;
|
private final Session session;
|
||||||
|
|
||||||
protected BaseRequest( @Nonnull Session session )
|
protected BaseRequest(@Nonnull Session session) {
|
||||||
{
|
this.session = nonNull(session, "session cannot be null");
|
||||||
this.session = nonNull( session, "session cannot be null" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public Session getSession()
|
public Session getSession() {
|
||||||
{
|
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T nonNull( T obj, String message )
|
public static <T> T nonNull(T obj, String message) {
|
||||||
{
|
if (obj == null) {
|
||||||
if ( obj == null )
|
throw new IllegalArgumentException(message);
|
||||||
{
|
|
||||||
throw new IllegalArgumentException( message );
|
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static <T> Collection<T> unmodifiable( Collection<T> obj )
|
protected static <T> Collection<T> unmodifiable(Collection<T> obj) {
|
||||||
{
|
|
||||||
return obj != null && !obj.isEmpty()
|
return obj != null && !obj.isEmpty()
|
||||||
? Collections.unmodifiableCollection( new ArrayList<>( obj ) ) : Collections.emptyList();
|
? Collections.unmodifiableCollection(new ArrayList<>(obj))
|
||||||
|
: Collections.emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -32,8 +31,7 @@ import org.apache.maven.api.annotations.Nullable;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface BuilderProblem
|
public interface BuilderProblem {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the hint about the source of the problem. While the syntax of this hint is unspecified and depends on the
|
* Gets the hint about the source of the problem. While the syntax of this hint is unspecified and depends on the
|
||||||
|
@ -102,12 +100,9 @@ public interface BuilderProblem
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
enum Severity
|
enum Severity {
|
||||||
{
|
|
||||||
|
|
||||||
FATAL, //
|
FATAL, //
|
||||||
ERROR, //
|
ERROR, //
|
||||||
WARNING //
|
WARNING //
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,15 +16,15 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.DependencyCoordinate;
|
import org.apache.maven.api.DependencyCoordinate;
|
||||||
import org.apache.maven.api.Project;
|
import org.apache.maven.api.Project;
|
||||||
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DependencyCollector service can be used to collect dependencies
|
* The DependencyCollector service can be used to collect dependencies
|
||||||
|
@ -37,8 +35,7 @@ import org.apache.maven.api.Project;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface DependencyCollector extends Service
|
public interface DependencyCollector extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects the transitive dependencies and builds a dependency graph.
|
* Collects the transitive dependencies and builds a dependency graph.
|
||||||
|
@ -55,7 +52,7 @@ public interface DependencyCollector extends Service
|
||||||
* @see DependencyCollector#collect(Session, Artifact)
|
* @see DependencyCollector#collect(Session, Artifact)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
DependencyCollectorResult collect( @Nonnull DependencyCollectorRequest request );
|
DependencyCollectorResult collect(@Nonnull DependencyCollectorRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
|
* Collects the transitive dependencies of some artifacts and builds a dependency graph. Note that this operation is
|
||||||
|
@ -70,10 +67,8 @@ public interface DependencyCollector extends Service
|
||||||
* @see #collect(DependencyCollectorRequest)
|
* @see #collect(DependencyCollectorRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCollectorResult collect( @Nonnull Session session,
|
default DependencyCollectorResult collect(@Nonnull Session session, @Nonnull DependencyCoordinate root) {
|
||||||
@Nonnull DependencyCoordinate root )
|
return collect(DependencyCollectorRequest.build(session, root));
|
||||||
{
|
|
||||||
return collect( DependencyCollectorRequest.build( session, root ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,10 +84,8 @@ public interface DependencyCollector extends Service
|
||||||
* @see #collect(DependencyCollectorRequest)
|
* @see #collect(DependencyCollectorRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCollectorResult collect( @Nonnull Session session,
|
default DependencyCollectorResult collect(@Nonnull Session session, @Nonnull Project project) {
|
||||||
@Nonnull Project project )
|
return collect(DependencyCollectorRequest.build(session, project));
|
||||||
{
|
|
||||||
return collect( DependencyCollectorRequest.build( session, project ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,10 +101,7 @@ public interface DependencyCollector extends Service
|
||||||
* @see #collect(DependencyCollectorRequest)
|
* @see #collect(DependencyCollectorRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCollectorResult collect( @Nonnull Session session,
|
default DependencyCollectorResult collect(@Nonnull Session session, @Nonnull Artifact artifact) {
|
||||||
@Nonnull Artifact artifact )
|
return collect(DependencyCollectorRequest.build(session, artifact));
|
||||||
{
|
|
||||||
return collect( DependencyCollectorRequest.build( session, artifact ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -28,9 +27,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class DependencyCollectorException
|
public class DependencyCollectorException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -40,8 +37,7 @@ public class DependencyCollectorException
|
||||||
* @param message the message you would give for the exception
|
* @param message the message you would give for the exception
|
||||||
* @param cause the cause which is related to the message
|
* @param cause the cause which is related to the message
|
||||||
*/
|
*/
|
||||||
public DependencyCollectorException( String message, Throwable cause )
|
public DependencyCollectorException(String message, Throwable cause) {
|
||||||
{
|
super(message, cause);
|
||||||
super( message, cause );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,13 +16,15 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.DependencyCoordinate;
|
import org.apache.maven.api.DependencyCoordinate;
|
||||||
import org.apache.maven.api.Project;
|
import org.apache.maven.api.Project;
|
||||||
|
@ -35,8 +35,6 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A request to collect the transitive dependencies and to build a dependency graph from them. There are three ways to
|
* A request to collect the transitive dependencies and to build a dependency graph from them. There are three ways to
|
||||||
* create a dependency graph. First, only the root dependency can be given. Second, a root dependency and direct
|
* create a dependency graph. First, only the root dependency can be given. Second, a root dependency and direct
|
||||||
|
@ -49,8 +47,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface DependencyCollectorRequest
|
public interface DependencyCollectorRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -70,43 +67,38 @@ public interface DependencyCollectorRequest
|
||||||
boolean getVerbose();
|
boolean getVerbose();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCollectorRequest build( @Nonnull Session session, Artifact root )
|
static DependencyCollectorRequest build(@Nonnull Session session, Artifact root) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.rootArtifact( nonNull( root, "root cannot be null" ) )
|
.rootArtifact(nonNull(root, "root cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCollectorRequest build( @Nonnull Session session, @Nonnull DependencyCoordinate root )
|
static DependencyCollectorRequest build(@Nonnull Session session, @Nonnull DependencyCoordinate root) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.root( nonNull( root, "root cannot be null" ) )
|
.root(nonNull(root, "root cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCollectorRequest build( @Nonnull Session session, @Nonnull Project project )
|
static DependencyCollectorRequest build(@Nonnull Session session, @Nonnull Project project) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.rootArtifact( nonNull( project, "project cannot be null" ).getArtifact() )
|
.rootArtifact(nonNull(project, "project cannot be null").getArtifact())
|
||||||
.dependencies( project.getDependencies() )
|
.dependencies(project.getDependencies())
|
||||||
.managedDependencies( project.getManagedDependencies() )
|
.managedDependencies(project.getManagedDependencies())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCollectorRequestBuilder builder()
|
static DependencyCollectorRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new DependencyCollectorRequestBuilder();
|
return new DependencyCollectorRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class DependencyCollectorRequestBuilder
|
class DependencyCollectorRequestBuilder {
|
||||||
{
|
|
||||||
|
|
||||||
Session session;
|
Session session;
|
||||||
Artifact rootArtifact;
|
Artifact rootArtifact;
|
||||||
|
@ -115,13 +107,10 @@ public interface DependencyCollectorRequest
|
||||||
List<DependencyCoordinate> managedDependencies = Collections.emptyList();
|
List<DependencyCoordinate> managedDependencies = Collections.emptyList();
|
||||||
boolean verbose;
|
boolean verbose;
|
||||||
|
|
||||||
DependencyCollectorRequestBuilder()
|
DependencyCollectorRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder session( @Nonnull Session session )
|
public DependencyCollectorRequestBuilder session(@Nonnull Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -138,8 +127,7 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder rootArtifact( @Nullable Artifact rootArtifact )
|
public DependencyCollectorRequestBuilder rootArtifact(@Nullable Artifact rootArtifact) {
|
||||||
{
|
|
||||||
this.rootArtifact = rootArtifact;
|
this.rootArtifact = rootArtifact;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -149,8 +137,7 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder root( @Nonnull DependencyCoordinate root )
|
public DependencyCollectorRequestBuilder root(@Nonnull DependencyCoordinate root) {
|
||||||
{
|
|
||||||
this.root = root;
|
this.root = root;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -164,9 +151,8 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder dependencies( @Nullable List<DependencyCoordinate> dependencies )
|
public DependencyCollectorRequestBuilder dependencies(@Nullable List<DependencyCoordinate> dependencies) {
|
||||||
{
|
this.dependencies = (dependencies != null) ? dependencies : Collections.emptyList();
|
||||||
this.dependencies = ( dependencies != null ) ? dependencies : Collections.emptyList();
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,20 +163,16 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder dependency( @Nullable DependencyCoordinate dependency )
|
public DependencyCollectorRequestBuilder dependency(@Nullable DependencyCoordinate dependency) {
|
||||||
{
|
if (dependency != null) {
|
||||||
if ( dependency != null )
|
if (this.dependencies.isEmpty()) {
|
||||||
{
|
|
||||||
if ( this.dependencies.isEmpty() )
|
|
||||||
{
|
|
||||||
this.dependencies = new ArrayList<>();
|
this.dependencies = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.dependencies.add( dependency );
|
this.dependencies.add(dependency);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the dependency management to apply to transitive dependencies. To clarify, this management does not
|
* Sets the dependency management to apply to transitive dependencies. To clarify, this management does not
|
||||||
* apply to
|
* apply to
|
||||||
|
@ -201,9 +183,8 @@ public interface DependencyCollectorRequest
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder managedDependencies(
|
public DependencyCollectorRequestBuilder managedDependencies(
|
||||||
@Nullable List<DependencyCoordinate> managedDependencies )
|
@Nullable List<DependencyCoordinate> managedDependencies) {
|
||||||
{
|
this.managedDependencies = (managedDependencies != null) ? managedDependencies : Collections.emptyList();
|
||||||
this.managedDependencies = ( managedDependencies != null ) ? managedDependencies : Collections.emptyList();
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,15 +196,12 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder managedDependency( @Nullable DependencyCoordinate managedDependency )
|
public DependencyCollectorRequestBuilder managedDependency(@Nullable DependencyCoordinate managedDependency) {
|
||||||
{
|
if (managedDependency != null) {
|
||||||
if ( managedDependency != null )
|
if (this.managedDependencies.isEmpty()) {
|
||||||
{
|
|
||||||
if ( this.managedDependencies.isEmpty() )
|
|
||||||
{
|
|
||||||
this.managedDependencies = new ArrayList<>();
|
this.managedDependencies = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.managedDependencies.add( managedDependency );
|
this.managedDependencies.add(managedDependency);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -235,34 +213,24 @@ public interface DependencyCollectorRequest
|
||||||
* @return this request for chaining, never {@code null}
|
* @return this request for chaining, never {@code null}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequestBuilder verbose( boolean verbose )
|
public DependencyCollectorRequestBuilder verbose(boolean verbose) {
|
||||||
{
|
|
||||||
this.verbose = verbose;
|
this.verbose = verbose;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public DependencyCollectorRequest build()
|
public DependencyCollectorRequest build() {
|
||||||
{
|
|
||||||
return new DefaultDependencyCollectorRequest(
|
return new DefaultDependencyCollectorRequest(
|
||||||
session,
|
session, rootArtifact, root, dependencies, managedDependencies, verbose);
|
||||||
rootArtifact,
|
|
||||||
root,
|
|
||||||
dependencies,
|
|
||||||
managedDependencies,
|
|
||||||
verbose );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class DefaultDependencyCollectorRequest extends BaseRequest
|
static class DefaultDependencyCollectorRequest extends BaseRequest implements DependencyCollectorRequest {
|
||||||
implements DependencyCollectorRequest
|
|
||||||
{
|
|
||||||
private final Artifact rootArtifact;
|
private final Artifact rootArtifact;
|
||||||
private final DependencyCoordinate root;
|
private final DependencyCoordinate root;
|
||||||
private final Collection<DependencyCoordinate> dependencies;
|
private final Collection<DependencyCoordinate> dependencies;
|
||||||
private final Collection<DependencyCoordinate> managedDependencies;
|
private final Collection<DependencyCoordinate> managedDependencies;
|
||||||
private final boolean verbose;
|
private final boolean verbose;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a request with the specified properties.
|
* Creates a request with the specified properties.
|
||||||
*
|
*
|
||||||
|
@ -276,59 +244,50 @@ public interface DependencyCollectorRequest
|
||||||
@Nullable DependencyCoordinate root,
|
@Nullable DependencyCoordinate root,
|
||||||
@Nonnull Collection<DependencyCoordinate> dependencies,
|
@Nonnull Collection<DependencyCoordinate> dependencies,
|
||||||
@Nonnull Collection<DependencyCoordinate> managedDependencies,
|
@Nonnull Collection<DependencyCoordinate> managedDependencies,
|
||||||
boolean verbose )
|
boolean verbose) {
|
||||||
{
|
super(session);
|
||||||
super( session );
|
|
||||||
this.rootArtifact = rootArtifact;
|
this.rootArtifact = rootArtifact;
|
||||||
this.root = root;
|
this.root = root;
|
||||||
this.dependencies = unmodifiable( nonNull( dependencies, "dependencies cannot be null" ) );
|
this.dependencies = unmodifiable(nonNull(dependencies, "dependencies cannot be null"));
|
||||||
this.managedDependencies = unmodifiable( nonNull( managedDependencies,
|
this.managedDependencies =
|
||||||
"managedDependencies cannot be null" ) );
|
unmodifiable(nonNull(managedDependencies, "managedDependencies cannot be null"));
|
||||||
this.verbose = verbose;
|
this.verbose = verbose;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Artifact> getRootArtifact()
|
public Optional<Artifact> getRootArtifact() {
|
||||||
{
|
return Optional.ofNullable(rootArtifact);
|
||||||
return Optional.ofNullable( rootArtifact );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<DependencyCoordinate> getRoot()
|
public Optional<DependencyCoordinate> getRoot() {
|
||||||
{
|
return Optional.ofNullable(root);
|
||||||
return Optional.ofNullable( root );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<DependencyCoordinate> getDependencies()
|
public Collection<DependencyCoordinate> getDependencies() {
|
||||||
{
|
|
||||||
return dependencies;
|
return dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<DependencyCoordinate> getManagedDependencies()
|
public Collection<DependencyCoordinate> getManagedDependencies() {
|
||||||
{
|
|
||||||
return managedDependencies;
|
return managedDependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getVerbose()
|
public boolean getVerbose() {
|
||||||
{
|
|
||||||
return verbose;
|
return verbose;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString() {
|
||||||
{
|
|
||||||
return getRoot() + " -> " + getDependencies();
|
return getRoot() + " -> " + getDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.api.Node;
|
import org.apache.maven.api.Node;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -31,20 +29,18 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @see DependencyCollector#collect(DependencyCollectorRequest)
|
* @see DependencyCollector#collect(DependencyCollectorRequest)
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface DependencyCollectorResult
|
public interface DependencyCollectorResult {
|
||||||
{
|
/**
|
||||||
/**
|
* Gets the exceptions that occurred while building the dependency graph.
|
||||||
* Gets the exceptions that occurred while building the dependency graph.
|
*
|
||||||
*
|
* @return the exceptions that occurred, never {@code null}
|
||||||
* @return the exceptions that occurred, never {@code null}
|
*/
|
||||||
*/
|
List<Exception> getExceptions();
|
||||||
List<Exception> getExceptions();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the root node of the dependency graph.
|
|
||||||
*
|
|
||||||
* @return the root node of the dependency graph or {@code null} if none
|
|
||||||
*/
|
|
||||||
Node getRoot();
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the root node of the dependency graph.
|
||||||
|
*
|
||||||
|
* @return the root node of the dependency graph or {@code null} if none
|
||||||
|
*/
|
||||||
|
Node getRoot();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
import org.apache.maven.api.DependencyCoordinate;
|
import org.apache.maven.api.DependencyCoordinate;
|
||||||
|
@ -34,8 +33,7 @@ import org.apache.maven.api.model.ReportPlugin;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface DependencyCoordinateFactory extends Service
|
public interface DependencyCoordinateFactory extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link DependencyCoordinate} object from the request.
|
* Creates a new {@link DependencyCoordinate} object from the request.
|
||||||
|
@ -47,43 +45,47 @@ public interface DependencyCoordinateFactory extends Service
|
||||||
* if {@code request.getSession()} is null or invalid
|
* if {@code request.getSession()} is null or invalid
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
DependencyCoordinate create( @Nonnull DependencyCoordinateFactoryRequest request );
|
DependencyCoordinate create(@Nonnull DependencyCoordinateFactoryRequest request);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCoordinate create( @Nonnull Session session, @Nonnull ArtifactCoordinate coordinate )
|
default DependencyCoordinate create(@Nonnull Session session, @Nonnull ArtifactCoordinate coordinate) {
|
||||||
{
|
return create(DependencyCoordinateFactoryRequest.build(session, coordinate));
|
||||||
return create( DependencyCoordinateFactoryRequest.build( session, coordinate ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCoordinate create( @Nonnull Session session, @Nonnull org.apache.maven.api.Dependency dependency )
|
default DependencyCoordinate create(@Nonnull Session session, @Nonnull org.apache.maven.api.Dependency dependency) {
|
||||||
{
|
return create(DependencyCoordinateFactoryRequest.build(session, dependency));
|
||||||
return create( DependencyCoordinateFactoryRequest.build( session, dependency ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCoordinate create( @Nonnull Session session, Dependency dependency )
|
default DependencyCoordinate create(@Nonnull Session session, Dependency dependency) {
|
||||||
{
|
return create(DependencyCoordinateFactoryRequest.build(
|
||||||
return create( DependencyCoordinateFactoryRequest.build( session,
|
session,
|
||||||
dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(),
|
dependency.getGroupId(),
|
||||||
dependency.getClassifier(), null, dependency.getType() ) );
|
dependency.getArtifactId(),
|
||||||
|
dependency.getVersion(),
|
||||||
|
dependency.getClassifier(),
|
||||||
|
null,
|
||||||
|
dependency.getType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCoordinate create( @Nonnull Session session, Plugin plugin )
|
default DependencyCoordinate create(@Nonnull Session session, Plugin plugin) {
|
||||||
{
|
|
||||||
// TODO: hard coded string
|
// TODO: hard coded string
|
||||||
return create( DependencyCoordinateFactoryRequest.build( session,
|
return create(DependencyCoordinateFactoryRequest.build(
|
||||||
plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(),
|
session, plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), null, null, "maven-plugin"));
|
||||||
null, null, "maven-plugin" ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default DependencyCoordinate create( @Nonnull Session session, ReportPlugin reportPlugin )
|
default DependencyCoordinate create(@Nonnull Session session, ReportPlugin reportPlugin) {
|
||||||
{
|
|
||||||
// TODO: hard coded string
|
// TODO: hard coded string
|
||||||
return create( DependencyCoordinateFactoryRequest.build( session,
|
return create(DependencyCoordinateFactoryRequest.build(
|
||||||
reportPlugin.getGroupId(), reportPlugin.getArtifactId(), reportPlugin.getVersion(),
|
session,
|
||||||
null, null, "maven-plugin" ) );
|
reportPlugin.getGroupId(),
|
||||||
|
reportPlugin.getArtifactId(),
|
||||||
|
reportPlugin.getVersion(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
"maven-plugin"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,11 +16,13 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
import org.apache.maven.api.Dependency;
|
import org.apache.maven.api.Dependency;
|
||||||
import org.apache.maven.api.Exclusion;
|
import org.apache.maven.api.Exclusion;
|
||||||
|
@ -32,16 +32,13 @@ import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFactoryRequest
|
public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFactoryRequest {
|
||||||
{
|
|
||||||
|
|
||||||
String getScope();
|
String getScope();
|
||||||
|
|
||||||
|
@ -51,58 +48,59 @@ public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFa
|
||||||
Collection<Exclusion> getExclusions();
|
Collection<Exclusion> getExclusions();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCoordinateFactoryRequest build( @Nonnull Session session, String groupId, String artifactId,
|
static DependencyCoordinateFactoryRequest build(
|
||||||
String version, String classifier, String extension, String type )
|
@Nonnull Session session,
|
||||||
{
|
String groupId,
|
||||||
|
String artifactId,
|
||||||
|
String version,
|
||||||
|
String classifier,
|
||||||
|
String extension,
|
||||||
|
String type) {
|
||||||
return DependencyCoordinateFactoryRequest.builder()
|
return DependencyCoordinateFactoryRequest.builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( groupId )
|
.groupId(groupId)
|
||||||
.artifactId( artifactId )
|
.artifactId(artifactId)
|
||||||
.version( version )
|
.version(version)
|
||||||
.classifier( classifier )
|
.classifier(classifier)
|
||||||
.extension( extension )
|
.extension(extension)
|
||||||
.type( type )
|
.type(type)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCoordinateFactoryRequest build( @Nonnull Session session, @Nonnull ArtifactCoordinate coordinate )
|
static DependencyCoordinateFactoryRequest build(@Nonnull Session session, @Nonnull ArtifactCoordinate coordinate) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( nonNull( coordinate, "coordinate cannot be null" ).getGroupId() )
|
.groupId(nonNull(coordinate, "coordinate cannot be null").getGroupId())
|
||||||
.artifactId( coordinate.getArtifactId() )
|
.artifactId(coordinate.getArtifactId())
|
||||||
.version( coordinate.getVersion().asString() )
|
.version(coordinate.getVersion().asString())
|
||||||
.classifier( coordinate.getClassifier() )
|
.classifier(coordinate.getClassifier())
|
||||||
.extension( coordinate.getExtension() )
|
.extension(coordinate.getExtension())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCoordinateFactoryRequest build( @Nonnull Session session, @Nonnull Dependency dependency )
|
static DependencyCoordinateFactoryRequest build(@Nonnull Session session, @Nonnull Dependency dependency) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.groupId( nonNull( dependency, "dependency" ).getGroupId() )
|
.groupId(nonNull(dependency, "dependency").getGroupId())
|
||||||
.artifactId( dependency.getArtifactId() )
|
.artifactId(dependency.getArtifactId())
|
||||||
.version( dependency.getVersion().asString() )
|
.version(dependency.getVersion().asString())
|
||||||
.classifier( dependency.getClassifier() )
|
.classifier(dependency.getClassifier())
|
||||||
.extension( dependency.getExtension() )
|
.extension(dependency.getExtension())
|
||||||
.type( dependency.getType().getName() )
|
.type(dependency.getType().getName())
|
||||||
.scope( dependency.getScope().id() )
|
.scope(dependency.getScope().id())
|
||||||
.optional( dependency.isOptional() )
|
.optional(dependency.isOptional())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static DependencyCoordinateFactoryRequestBuilder builder()
|
static DependencyCoordinateFactoryRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new DependencyCoordinateFactoryRequestBuilder();
|
return new DependencyCoordinateFactoryRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class DependencyCoordinateFactoryRequestBuilder
|
class DependencyCoordinateFactoryRequestBuilder {
|
||||||
{
|
|
||||||
private Session session;
|
private Session session;
|
||||||
private String groupId;
|
private String groupId;
|
||||||
private String artifactId;
|
private String artifactId;
|
||||||
|
@ -114,100 +112,80 @@ public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFa
|
||||||
private boolean optional;
|
private boolean optional;
|
||||||
private Collection<Exclusion> exclusions = Collections.emptyList();
|
private Collection<Exclusion> exclusions = Collections.emptyList();
|
||||||
|
|
||||||
DependencyCoordinateFactoryRequestBuilder()
|
DependencyCoordinateFactoryRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder session( Session session )
|
public DependencyCoordinateFactoryRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder groupId( String groupId )
|
public DependencyCoordinateFactoryRequestBuilder groupId(String groupId) {
|
||||||
{
|
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder artifactId( String artifactId )
|
public DependencyCoordinateFactoryRequestBuilder artifactId(String artifactId) {
|
||||||
{
|
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder version( String version )
|
public DependencyCoordinateFactoryRequestBuilder version(String version) {
|
||||||
{
|
|
||||||
this.version = version;
|
this.version = version;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder classifier( String classifier )
|
public DependencyCoordinateFactoryRequestBuilder classifier(String classifier) {
|
||||||
{
|
|
||||||
this.classifier = classifier;
|
this.classifier = classifier;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder extension( String extension )
|
public DependencyCoordinateFactoryRequestBuilder extension(String extension) {
|
||||||
{
|
|
||||||
this.extension = extension;
|
this.extension = extension;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder type( String type )
|
public DependencyCoordinateFactoryRequestBuilder type(String type) {
|
||||||
{
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder scope( String scope )
|
public DependencyCoordinateFactoryRequestBuilder scope(String scope) {
|
||||||
{
|
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder optional( boolean optional )
|
public DependencyCoordinateFactoryRequestBuilder optional(boolean optional) {
|
||||||
{
|
|
||||||
this.optional = optional;
|
this.optional = optional;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder exclusions( Collection<Exclusion> exclusions )
|
public DependencyCoordinateFactoryRequestBuilder exclusions(Collection<Exclusion> exclusions) {
|
||||||
{
|
if (exclusions != null) {
|
||||||
if ( exclusions != null )
|
if (this.exclusions.isEmpty()) {
|
||||||
{
|
|
||||||
if ( this.exclusions.isEmpty() )
|
|
||||||
{
|
|
||||||
this.exclusions = new ArrayList<>();
|
this.exclusions = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.exclusions.addAll( exclusions );
|
this.exclusions.addAll(exclusions);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequestBuilder exclusion( Exclusion exclusion )
|
public DependencyCoordinateFactoryRequestBuilder exclusion(Exclusion exclusion) {
|
||||||
{
|
if (exclusion != null) {
|
||||||
if ( exclusion != null )
|
if (this.exclusions.isEmpty()) {
|
||||||
{
|
|
||||||
if ( this.exclusions.isEmpty() )
|
|
||||||
{
|
|
||||||
this.exclusions = new ArrayList<>();
|
this.exclusions = new ArrayList<>();
|
||||||
}
|
}
|
||||||
this.exclusions.add( exclusion );
|
this.exclusions.add(exclusion);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DependencyCoordinateFactoryRequest build()
|
public DependencyCoordinateFactoryRequest build() {
|
||||||
{
|
return new DefaultDependencyCoordinateFactoryRequest(
|
||||||
return new DefaultDependencyCoordinateFactoryRequest( session, groupId, artifactId, version,
|
session, groupId, artifactId, version, classifier, extension, type, scope, optional, exclusions);
|
||||||
classifier, extension, type, scope, optional, exclusions );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultDependencyCoordinateFactoryRequest
|
private static class DefaultDependencyCoordinateFactoryRequest extends BaseRequest
|
||||||
extends BaseRequest
|
implements DependencyCoordinateFactoryRequest {
|
||||||
implements DependencyCoordinateFactoryRequest
|
|
||||||
{
|
|
||||||
private final String groupId;
|
private final String groupId;
|
||||||
private final String artifactId;
|
private final String artifactId;
|
||||||
private final String version;
|
private final String version;
|
||||||
|
@ -218,19 +196,19 @@ public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFa
|
||||||
private final boolean optional;
|
private final boolean optional;
|
||||||
private final Collection<Exclusion> exclusions;
|
private final Collection<Exclusion> exclusions;
|
||||||
|
|
||||||
@SuppressWarnings( "checkstyle:ParameterNumber" )
|
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||||
private DefaultDependencyCoordinateFactoryRequest(
|
private DefaultDependencyCoordinateFactoryRequest(
|
||||||
@Nonnull Session session, String groupId,
|
@Nonnull Session session,
|
||||||
String artifactId,
|
String groupId,
|
||||||
String version,
|
String artifactId,
|
||||||
String classifier,
|
String version,
|
||||||
String extension,
|
String classifier,
|
||||||
String type,
|
String extension,
|
||||||
String scope,
|
String type,
|
||||||
boolean optional,
|
String scope,
|
||||||
Collection<Exclusion> exclusions )
|
boolean optional,
|
||||||
{
|
Collection<Exclusion> exclusions) {
|
||||||
super( session );
|
super(session);
|
||||||
this.groupId = groupId;
|
this.groupId = groupId;
|
||||||
this.artifactId = artifactId;
|
this.artifactId = artifactId;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
@ -243,60 +221,50 @@ public interface DependencyCoordinateFactoryRequest extends ArtifactCoordinateFa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupId()
|
public String getGroupId() {
|
||||||
{
|
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArtifactId()
|
public String getArtifactId() {
|
||||||
{
|
|
||||||
return artifactId;
|
return artifactId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersion()
|
public String getVersion() {
|
||||||
{
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getClassifier()
|
public String getClassifier() {
|
||||||
{
|
|
||||||
return classifier;
|
return classifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getExtension()
|
public String getExtension() {
|
||||||
{
|
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType()
|
public String getType() {
|
||||||
{
|
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getScope()
|
public String getScope() {
|
||||||
{
|
|
||||||
return scope;
|
return scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOptional()
|
public boolean isOptional() {
|
||||||
{
|
|
||||||
return optional;
|
return optional;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Collection<Exclusion> getExclusions()
|
public Collection<Exclusion> getExclusions() {
|
||||||
{
|
|
||||||
return exclusions;
|
return exclusions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.LocalRepository;
|
import org.apache.maven.api.LocalRepository;
|
||||||
import org.apache.maven.api.RemoteRepository;
|
import org.apache.maven.api.RemoteRepository;
|
||||||
|
@ -33,11 +31,9 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface LocalRepositoryManager extends Service
|
public interface LocalRepositoryManager extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
Path getPathForLocalArtifact( Session session, LocalRepository local, Artifact artifact );
|
Path getPathForLocalArtifact(Session session, LocalRepository local, Artifact artifact);
|
||||||
|
|
||||||
Path getPathForRemoteArtifact( Session session, LocalRepository local, RemoteRepository remote, Artifact artifact );
|
|
||||||
|
|
||||||
|
Path getPathForRemoteArtifact(Session session, LocalRepository local, RemoteRepository remote, Artifact artifact);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,21 +16,19 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
|
|
||||||
public interface Lookup extends Service
|
public interface Lookup extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
<T> T lookup( Class<T> type );
|
<T> T lookup(Class<T> type);
|
||||||
|
|
||||||
<T> T lookup( Class<T> type, String name );
|
<T> T lookup(Class<T> type, String name);
|
||||||
|
|
||||||
<T> List<T> lookupList( Class<T> type );
|
<T> List<T> lookupList(Class<T> type);
|
||||||
|
|
||||||
<T> Map<String, T> lookupMap( Class<T> type );
|
|
||||||
|
|
||||||
|
<T> Map<String, T> lookupMap(Class<T> type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,24 +26,19 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class LookupException
|
public class LookupException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public LookupException( String message, Exception e )
|
public LookupException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public LookupException( Exception e )
|
public LookupException(Exception e) {
|
||||||
{
|
super(e);
|
||||||
super( e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,25 +26,18 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class MavenException extends RuntimeException
|
public class MavenException extends RuntimeException {
|
||||||
{
|
public MavenException() {}
|
||||||
public MavenException()
|
|
||||||
{
|
public MavenException(String message) {
|
||||||
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenException( String message )
|
public MavenException(String message, Throwable cause) {
|
||||||
{
|
super(message, cause);
|
||||||
super( message );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenException( String message, Throwable cause )
|
public MavenException(Throwable cause) {
|
||||||
{
|
super(cause);
|
||||||
super( message, cause );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MavenException( Throwable cause )
|
|
||||||
{
|
|
||||||
super( cause );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
|
@ -27,8 +26,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
* @see MessageBuilderFactory
|
* @see MessageBuilderFactory
|
||||||
*/
|
*/
|
||||||
public interface MessageBuilder
|
public interface MessageBuilder {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Append message content in success style.
|
* Append message content in success style.
|
||||||
* By default, bold green
|
* By default, bold green
|
||||||
|
@ -36,8 +34,8 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder success( Object message );
|
MessageBuilder success(Object message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append message content in warning style.
|
* Append message content in warning style.
|
||||||
* By default, bold yellow
|
* By default, bold yellow
|
||||||
|
@ -45,8 +43,8 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder warning( Object message );
|
MessageBuilder warning(Object message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append message content in failure style.
|
* Append message content in failure style.
|
||||||
* By default, bold red
|
* By default, bold red
|
||||||
|
@ -54,7 +52,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder failure( Object message );
|
MessageBuilder failure(Object message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append message content in strong style.
|
* Append message content in strong style.
|
||||||
|
@ -63,8 +61,8 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder strong( Object message );
|
MessageBuilder strong(Object message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append message content in mojo style.
|
* Append message content in mojo style.
|
||||||
* By default, green
|
* By default, green
|
||||||
|
@ -72,8 +70,8 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder mojo( Object message );
|
MessageBuilder mojo(Object message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append message content in project style.
|
* Append message content in project style.
|
||||||
* By default, cyan
|
* By default, cyan
|
||||||
|
@ -81,8 +79,8 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder project( Object message );
|
MessageBuilder project(Object message);
|
||||||
|
|
||||||
//
|
//
|
||||||
// message building methods modelled after Ansi methods
|
// message building methods modelled after Ansi methods
|
||||||
//
|
//
|
||||||
|
@ -94,7 +92,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder a( char[] value, int offset, int len );
|
MessageBuilder a(char[] value, int offset, int len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append content to the message buffer.
|
* Append content to the message buffer.
|
||||||
|
@ -102,7 +100,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder a( char[] value );
|
MessageBuilder a(char[] value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append content to the message buffer.
|
* Append content to the message buffer.
|
||||||
|
@ -112,7 +110,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder a( CharSequence value, int start, int end );
|
MessageBuilder a(CharSequence value, int start, int end);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append content to the message buffer.
|
* Append content to the message buffer.
|
||||||
|
@ -120,7 +118,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder a( CharSequence value );
|
MessageBuilder a(CharSequence value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append content to the message buffer.
|
* Append content to the message buffer.
|
||||||
|
@ -128,7 +126,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder a( Object value );
|
MessageBuilder a(Object value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append newline to the message buffer.
|
* Append newline to the message buffer.
|
||||||
|
@ -145,7 +143,7 @@ public interface MessageBuilder
|
||||||
* @return the current builder
|
* @return the current builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder format( String pattern, Object... args );
|
MessageBuilder format(String pattern, Object... args);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the built message.
|
* Return the built message.
|
||||||
|
@ -153,5 +151,4 @@ public interface MessageBuilder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
String build();
|
String build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -29,8 +28,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface MessageBuilderFactory extends Service
|
public interface MessageBuilderFactory extends Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Checks if the underlying output does support styling or not.
|
* Checks if the underlying output does support styling or not.
|
||||||
* @return whether color styling is supported or not
|
* @return whether color styling is supported or not
|
||||||
|
@ -56,7 +54,7 @@ public interface MessageBuilderFactory extends Service
|
||||||
* @return a new message builder
|
* @return a new message builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
MessageBuilder builder( @Nonnull StringBuilder stringBuilder );
|
MessageBuilder builder(@Nonnull StringBuilder stringBuilder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new message builder of the specified size.
|
* Creates a new message builder of the specified size.
|
||||||
|
@ -64,8 +62,7 @@ public interface MessageBuilderFactory extends Service
|
||||||
* @return a new message builder
|
* @return a new message builder
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default MessageBuilder builder( int size )
|
default MessageBuilder builder(int size) {
|
||||||
{
|
return builder(new StringBuilder(size));
|
||||||
return builder( new StringBuilder( size ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,23 +16,21 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ProjectBuilder extends Service
|
public interface ProjectBuilder extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link org.apache.maven.api.Project} from a POM file.
|
* Creates a {@link org.apache.maven.api.Project} from a POM file.
|
||||||
|
@ -45,7 +41,7 @@ public interface ProjectBuilder extends Service
|
||||||
* @throws IllegalArgumentException if an argument is {@code null} or invalid
|
* @throws IllegalArgumentException if an argument is {@code null} or invalid
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
ProjectBuilderResult build( ProjectBuilderRequest request );
|
ProjectBuilderResult build(ProjectBuilderRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link org.apache.maven.api.Project} from a POM file.
|
* Creates a {@link org.apache.maven.api.Project} from a POM file.
|
||||||
|
@ -57,9 +53,8 @@ public interface ProjectBuilder extends Service
|
||||||
* @see #build(ProjectBuilderRequest)
|
* @see #build(ProjectBuilderRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ProjectBuilderResult build( @Nonnull Session session, @Nonnull Source source )
|
default ProjectBuilderResult build(@Nonnull Session session, @Nonnull Source source) {
|
||||||
{
|
return build(ProjectBuilderRequest.build(session, source));
|
||||||
return build( ProjectBuilderRequest.build( session, source ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,9 +67,8 @@ public interface ProjectBuilder extends Service
|
||||||
* @see #build(ProjectBuilderRequest)
|
* @see #build(ProjectBuilderRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ProjectBuilderResult build( @Nonnull Session session, @Nonnull Path path )
|
default ProjectBuilderResult build(@Nonnull Session session, @Nonnull Path path) {
|
||||||
{
|
return build(ProjectBuilderRequest.build(session, path));
|
||||||
return build( ProjectBuilderRequest.build( session, path ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,9 +81,8 @@ public interface ProjectBuilder extends Service
|
||||||
* @see #build(ProjectBuilderRequest)
|
* @see #build(ProjectBuilderRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ProjectBuilderResult build( @Nonnull Session session, @Nonnull Artifact artifact )
|
default ProjectBuilderResult build(@Nonnull Session session, @Nonnull Artifact artifact) {
|
||||||
{
|
return build(ProjectBuilderRequest.build(session, artifact));
|
||||||
return build( ProjectBuilderRequest.build( session, artifact ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,9 +95,7 @@ public interface ProjectBuilder extends Service
|
||||||
* @see #build(ProjectBuilderRequest)
|
* @see #build(ProjectBuilderRequest)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default ProjectBuilderResult build( @Nonnull Session session, @Nonnull ArtifactCoordinate coordinate )
|
default ProjectBuilderResult build(@Nonnull Session session, @Nonnull ArtifactCoordinate coordinate) {
|
||||||
{
|
return build(ProjectBuilderRequest.build(session, coordinate));
|
||||||
return build( ProjectBuilderRequest.build( session, coordinate ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,12 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ProjectBuilderException
|
public class ProjectBuilderException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public ProjectBuilderException( String message, Exception e )
|
public ProjectBuilderException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,22 +16,21 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.Optional;
|
||||||
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.ArtifactCoordinate;
|
import org.apache.maven.api.ArtifactCoordinate;
|
||||||
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
|
||||||
import org.apache.maven.api.Artifact;
|
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request used to build a {@link org.apache.maven.api.Project} using
|
* Request used to build a {@link org.apache.maven.api.Project} using
|
||||||
* the {@link ProjectBuilder} service.
|
* the {@link ProjectBuilder} service.
|
||||||
|
@ -42,8 +39,7 @@ import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface ProjectBuilderRequest
|
public interface ProjectBuilderRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -69,50 +65,44 @@ public interface ProjectBuilderRequest
|
||||||
boolean isResolveDependencies();
|
boolean isResolveDependencies();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull Source source )
|
static ProjectBuilderRequest build(@Nonnull Session session, @Nonnull Source source) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.source( nonNull( source, "source cannot be null" ) )
|
.source(nonNull(source, "source cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull Path path )
|
static ProjectBuilderRequest build(@Nonnull Session session, @Nonnull Path path) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.path( nonNull( path, "path cannot be null" ) )
|
.path(nonNull(path, "path cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull Artifact artifact )
|
static ProjectBuilderRequest build(@Nonnull Session session, @Nonnull Artifact artifact) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.artifact( nonNull( artifact, "artifact cannot be null" ) )
|
.artifact(nonNull(artifact, "artifact cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ProjectBuilderRequest build( @Nonnull Session session, @Nonnull ArtifactCoordinate coordinate )
|
static ProjectBuilderRequest build(@Nonnull Session session, @Nonnull ArtifactCoordinate coordinate) {
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.coordinate( nonNull( coordinate, "coordinate cannot be null" ) )
|
.coordinate(nonNull(coordinate, "coordinate cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ProjectBuilderRequestBuilder builder()
|
static ProjectBuilderRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ProjectBuilderRequestBuilder();
|
return new ProjectBuilderRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ProjectBuilderRequestBuilder
|
class ProjectBuilderRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
Path path;
|
Path path;
|
||||||
Source source;
|
Source source;
|
||||||
|
@ -123,61 +113,57 @@ public interface ProjectBuilderRequest
|
||||||
boolean processPlugins = true;
|
boolean processPlugins = true;
|
||||||
boolean resolveDependencies = true;
|
boolean resolveDependencies = true;
|
||||||
|
|
||||||
ProjectBuilderRequestBuilder()
|
ProjectBuilderRequestBuilder() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder session( Session session )
|
public ProjectBuilderRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder path( Path path )
|
public ProjectBuilderRequestBuilder path(Path path) {
|
||||||
{
|
|
||||||
this.path = path;
|
this.path = path;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder source( Source source )
|
public ProjectBuilderRequestBuilder source(Source source) {
|
||||||
{
|
|
||||||
this.source = source;
|
this.source = source;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder artifact( Artifact artifact )
|
public ProjectBuilderRequestBuilder artifact(Artifact artifact) {
|
||||||
{
|
|
||||||
this.artifact = artifact;
|
this.artifact = artifact;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder coordinate( ArtifactCoordinate coordinate )
|
public ProjectBuilderRequestBuilder coordinate(ArtifactCoordinate coordinate) {
|
||||||
{
|
|
||||||
this.coordinate = coordinate;
|
this.coordinate = coordinate;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder processPlugins( boolean processPlugins )
|
public ProjectBuilderRequestBuilder processPlugins(boolean processPlugins) {
|
||||||
{
|
|
||||||
this.processPlugins = processPlugins;
|
this.processPlugins = processPlugins;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequestBuilder resolveDependencies( boolean resolveDependencies )
|
public ProjectBuilderRequestBuilder resolveDependencies(boolean resolveDependencies) {
|
||||||
{
|
|
||||||
this.resolveDependencies = resolveDependencies;
|
this.resolveDependencies = resolveDependencies;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectBuilderRequest build()
|
public ProjectBuilderRequest build() {
|
||||||
{
|
return new DefaultProjectBuilderRequest(
|
||||||
return new DefaultProjectBuilderRequest( session, path, source, artifact, coordinate,
|
session,
|
||||||
allowStubModel, recursive, processPlugins, resolveDependencies );
|
path,
|
||||||
|
source,
|
||||||
|
artifact,
|
||||||
|
coordinate,
|
||||||
|
allowStubModel,
|
||||||
|
recursive,
|
||||||
|
processPlugins,
|
||||||
|
resolveDependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultProjectBuilderRequest extends BaseRequest
|
private static class DefaultProjectBuilderRequest extends BaseRequest implements ProjectBuilderRequest {
|
||||||
implements ProjectBuilderRequest
|
|
||||||
{
|
|
||||||
private final Path path;
|
private final Path path;
|
||||||
private final Source source;
|
private final Source source;
|
||||||
private final Artifact artifact;
|
private final Artifact artifact;
|
||||||
|
@ -187,18 +173,18 @@ public interface ProjectBuilderRequest
|
||||||
private final boolean processPlugins;
|
private final boolean processPlugins;
|
||||||
private final boolean resolveDependencies;
|
private final boolean resolveDependencies;
|
||||||
|
|
||||||
@SuppressWarnings( "checkstyle:ParameterNumber" )
|
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||||
DefaultProjectBuilderRequest( @Nonnull Session session,
|
DefaultProjectBuilderRequest(
|
||||||
@Nullable Path path,
|
@Nonnull Session session,
|
||||||
@Nullable Source source,
|
@Nullable Path path,
|
||||||
@Nullable Artifact artifact,
|
@Nullable Source source,
|
||||||
@Nullable ArtifactCoordinate coordinate,
|
@Nullable Artifact artifact,
|
||||||
boolean allowStubModel,
|
@Nullable ArtifactCoordinate coordinate,
|
||||||
boolean recursive,
|
boolean allowStubModel,
|
||||||
boolean processPlugins,
|
boolean recursive,
|
||||||
boolean resolveDependencies )
|
boolean processPlugins,
|
||||||
{
|
boolean resolveDependencies) {
|
||||||
super( session );
|
super(session);
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.artifact = artifact;
|
this.artifact = artifact;
|
||||||
|
@ -211,56 +197,47 @@ public interface ProjectBuilderRequest
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Path> getPath()
|
public Optional<Path> getPath() {
|
||||||
{
|
return Optional.ofNullable(path);
|
||||||
return Optional.ofNullable( path );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Source> getSource()
|
public Optional<Source> getSource() {
|
||||||
{
|
return Optional.ofNullable(source);
|
||||||
return Optional.ofNullable( source );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Artifact> getArtifact()
|
public Optional<Artifact> getArtifact() {
|
||||||
{
|
return Optional.ofNullable(artifact);
|
||||||
return Optional.ofNullable( artifact );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<ArtifactCoordinate> getCoordinate()
|
public Optional<ArtifactCoordinate> getCoordinate() {
|
||||||
{
|
return Optional.ofNullable(coordinate);
|
||||||
return Optional.ofNullable( coordinate );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAllowStubModel()
|
public boolean isAllowStubModel() {
|
||||||
{
|
|
||||||
return allowStubModel;
|
return allowStubModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRecursive()
|
public boolean isRecursive() {
|
||||||
{
|
|
||||||
return recursive;
|
return recursive;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isProcessPlugins()
|
public boolean isProcessPlugins() {
|
||||||
{
|
|
||||||
return processPlugins;
|
return processPlugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isResolveDependencies()
|
public boolean isResolveDependencies() {
|
||||||
{
|
|
||||||
return resolveDependencies;
|
return resolveDependencies;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,15 +16,14 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Project;
|
import org.apache.maven.api.Project;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Result of a project build call.
|
* Result of a project build call.
|
||||||
|
@ -34,8 +31,7 @@ import org.apache.maven.api.Project;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ProjectBuilderResult
|
public interface ProjectBuilderResult {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the identifier of the project that could not be built. The general format of the identifier is {@code
|
* Gets the identifier of the project that could not be built. The general format of the identifier is {@code
|
||||||
|
@ -79,5 +75,4 @@ public interface ProjectBuilderResult
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Optional<DependencyCollectorResult> getDependencyResolverResult();
|
Optional<DependencyCollectorResult> getDependencyResolverResult();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,22 +16,21 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Artifact;
|
import org.apache.maven.api.Artifact;
|
||||||
import org.apache.maven.api.Node;
|
import org.apache.maven.api.Node;
|
||||||
import org.apache.maven.api.Project;
|
import org.apache.maven.api.Project;
|
||||||
import org.apache.maven.api.RemoteRepository;
|
import org.apache.maven.api.RemoteRepository;
|
||||||
import org.apache.maven.api.ResolutionScope;
|
import org.apache.maven.api.ResolutionScope;
|
||||||
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to manage the project during its lifecycle.
|
* Interface to manage the project during its lifecycle.
|
||||||
|
@ -41,8 +38,7 @@ import org.apache.maven.api.Session;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ProjectManager extends Service
|
public interface ProjectManager extends Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Returns the path to the resolved file in the local repository
|
* Returns the path to the resolved file in the local repository
|
||||||
* if the artifact has been resolved.
|
* if the artifact has been resolved.
|
||||||
|
@ -50,44 +46,41 @@ public interface ProjectManager extends Service
|
||||||
* @return the path of the resolved artifact
|
* @return the path of the resolved artifact
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Optional<Path> getPath( Project project );
|
Optional<Path> getPath(Project project);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Collection<Artifact> getAttachedArtifacts( Project project );
|
Collection<Artifact> getAttachedArtifacts(Project project);
|
||||||
|
|
||||||
default void attachArtifact( Session session, Project project, Path path )
|
default void attachArtifact(Session session, Project project, Path path) {
|
||||||
{
|
|
||||||
String name = path.getFileName().toString();
|
String name = path.getFileName().toString();
|
||||||
int dot = name.lastIndexOf( '.' );
|
int dot = name.lastIndexOf('.');
|
||||||
String ext = dot >= 1 ? name.substring( dot + 1 ) : "";
|
String ext = dot >= 1 ? name.substring(dot + 1) : "";
|
||||||
Artifact artifact = session.createArtifact( project.getGroupId(), project.getArtifactId(),
|
Artifact artifact =
|
||||||
project.getVersion(), ext );
|
session.createArtifact(project.getGroupId(), project.getArtifactId(), project.getVersion(), ext);
|
||||||
attachArtifact( project, artifact, path );
|
attachArtifact(project, artifact, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
default void attachArtifact( Session session, Project project, String type, Path path )
|
default void attachArtifact(Session session, Project project, String type, Path path) {
|
||||||
{
|
Artifact artifact = session.createArtifact(
|
||||||
Artifact artifact = session.createArtifact( project.getGroupId(), project.getArtifactId(),
|
project.getGroupId(), project.getArtifactId(), project.getVersion(), null, null, type);
|
||||||
project.getVersion(), null, null, type );
|
attachArtifact(project, artifact, path);
|
||||||
attachArtifact( project, artifact, path );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void attachArtifact( Project project, Artifact artifact, Path path );
|
void attachArtifact(Project project, Artifact artifact, Path path);
|
||||||
|
|
||||||
List<String> getCompileSourceRoots( Project project );
|
List<String> getCompileSourceRoots(Project project);
|
||||||
|
|
||||||
void addCompileSourceRoot( Project project, String sourceRoot );
|
void addCompileSourceRoot(Project project, String sourceRoot);
|
||||||
|
|
||||||
List<String> getTestCompileSourceRoots( Project project );
|
List<String> getTestCompileSourceRoots(Project project);
|
||||||
|
|
||||||
void addTestCompileSourceRoot( Project project, String sourceRoot );
|
void addTestCompileSourceRoot(Project project, String sourceRoot);
|
||||||
|
|
||||||
List<RemoteRepository> getRepositories( Project project );
|
List<RemoteRepository> getRepositories(Project project);
|
||||||
|
|
||||||
List<Artifact> getResolvedDependencies( Project project, ResolutionScope scope );
|
List<Artifact> getResolvedDependencies(Project project, ResolutionScope scope);
|
||||||
|
|
||||||
Node getCollectedDependencies( Project project, ResolutionScope scope );
|
Node getCollectedDependencies(Project project, ResolutionScope scope);
|
||||||
|
|
||||||
void setProperty( Project project, String key, String value );
|
|
||||||
|
|
||||||
|
void setProperty(Project project, String key, String value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -30,8 +28,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Prompter extends Service
|
public interface Prompter extends Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Prompts the user for a string.
|
* Prompts the user for a string.
|
||||||
*
|
*
|
||||||
|
@ -39,10 +36,8 @@ public interface Prompter extends Service
|
||||||
* @return the string entered by the user
|
* @return the string entered by the user
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
default String prompt( String message )
|
default String prompt(String message) throws PrompterException {
|
||||||
throws PrompterException
|
return prompt(message, null, null);
|
||||||
{
|
|
||||||
return prompt( message, null, null );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,10 +48,8 @@ public interface Prompter extends Service
|
||||||
* @return the string entered by the user
|
* @return the string entered by the user
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
default String prompt( String message, String defaultReply )
|
default String prompt(String message, String defaultReply) throws PrompterException {
|
||||||
throws PrompterException
|
return prompt(message, null, defaultReply);
|
||||||
{
|
|
||||||
return prompt( message, null, defaultReply );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,10 +60,8 @@ public interface Prompter extends Service
|
||||||
* @return the string entered by the user
|
* @return the string entered by the user
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
default String prompt( String message, List<String> possibleValues )
|
default String prompt(String message, List<String> possibleValues) throws PrompterException {
|
||||||
throws PrompterException
|
return prompt(message, possibleValues, null);
|
||||||
{
|
|
||||||
return prompt( message, possibleValues, null );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,8 +73,7 @@ public interface Prompter extends Service
|
||||||
* @return the string entered by the user
|
* @return the string entered by the user
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
String prompt( String message, List<String> possibleValues, String defaultReply )
|
String prompt(String message, List<String> possibleValues, String defaultReply) throws PrompterException;
|
||||||
throws PrompterException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompts the user for a password.
|
* Prompts the user for a password.
|
||||||
|
@ -92,8 +82,7 @@ public interface Prompter extends Service
|
||||||
* @return the password entered by the user
|
* @return the password entered by the user
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
String promptForPassword( String message )
|
String promptForPassword(String message) throws PrompterException;
|
||||||
throws PrompterException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a message to the user.
|
* Displays a message to the user.
|
||||||
|
@ -101,6 +90,5 @@ public interface Prompter extends Service
|
||||||
* @param message the message to display
|
* @param message the message to display
|
||||||
* @throws PrompterException if an exception occurs
|
* @throws PrompterException if an exception occurs
|
||||||
*/
|
*/
|
||||||
void showMessage( String message )
|
void showMessage(String message) throws PrompterException;
|
||||||
throws PrompterException;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,12 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class PrompterException
|
public class PrompterException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public PrompterException( String message, Exception e )
|
public PrompterException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.LocalRepository;
|
import org.apache.maven.api.LocalRepository;
|
||||||
import org.apache.maven.api.RemoteRepository;
|
import org.apache.maven.api.RemoteRepository;
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
|
@ -34,16 +32,14 @@ import org.apache.maven.api.model.Repository;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface RepositoryFactory extends Service
|
public interface RepositoryFactory extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
LocalRepository createLocal( @Nonnull Path path );
|
LocalRepository createLocal(@Nonnull Path path);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
RemoteRepository createRemote( @Nonnull String id, @Nonnull String url );
|
RemoteRepository createRemote(@Nonnull String id, @Nonnull String url);
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
RemoteRepository createRemote( @Nonnull Repository repository );
|
RemoteRepository createRemote(@Nonnull Repository repository);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,9 +16,9 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
@ -28,8 +26,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
/**
|
/**
|
||||||
* Builds the effective settings from a user settings file and/or a global settings file.
|
* Builds the effective settings from a user settings file and/or a global settings file.
|
||||||
*/
|
*/
|
||||||
public interface SettingsBuilder extends Service
|
public interface SettingsBuilder extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the effective settings of the specified settings files.
|
* Builds the effective settings of the specified settings files.
|
||||||
|
@ -39,7 +36,7 @@ public interface SettingsBuilder extends Service
|
||||||
* @throws SettingsBuilderException if the effective settings could not be built
|
* @throws SettingsBuilderException if the effective settings could not be built
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
SettingsBuilderResult build( @Nonnull SettingsBuilderRequest request );
|
SettingsBuilderResult build(@Nonnull SettingsBuilderRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the effective settings of the specified settings sources.
|
* Builds the effective settings of the specified settings sources.
|
||||||
|
@ -48,11 +45,9 @@ public interface SettingsBuilder extends Service
|
||||||
* @throws SettingsBuilderException if the effective settings could not be built
|
* @throws SettingsBuilderException if the effective settings could not be built
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default SettingsBuilderResult build( @Nonnull Session session,
|
default SettingsBuilderResult build(
|
||||||
@Nonnull Source globalSettingsSource,
|
@Nonnull Session session, @Nonnull Source globalSettingsSource, @Nonnull Source userSettingsSource) {
|
||||||
@Nonnull Source userSettingsSource )
|
return build(SettingsBuilderRequest.build(session, globalSettingsSource, userSettingsSource));
|
||||||
{
|
|
||||||
return build( SettingsBuilderRequest.build( session, globalSettingsSource, userSettingsSource ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,10 +57,8 @@ public interface SettingsBuilder extends Service
|
||||||
* @throws SettingsBuilderException if the effective settings could not be built
|
* @throws SettingsBuilderException if the effective settings could not be built
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default SettingsBuilderResult build( @Nonnull Session session,
|
default SettingsBuilderResult build(
|
||||||
@Nonnull Path globalSettingsPath,
|
@Nonnull Session session, @Nonnull Path globalSettingsPath, @Nonnull Path userSettingsPath) {
|
||||||
@Nonnull Path userSettingsPath )
|
return build(SettingsBuilderRequest.build(session, globalSettingsPath, userSettingsPath));
|
||||||
{
|
|
||||||
return build( SettingsBuilderRequest.build( session, globalSettingsPath, userSettingsPath ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,13 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class SettingsBuilderException
|
public class SettingsBuilderException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public SettingsBuilderException( String message, Exception e )
|
public SettingsBuilderException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add SettingsBuilderResult
|
// TODO: add SettingsBuilderResult
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,10 +16,12 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
|
@ -29,15 +29,12 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects settings that control the building of effective settings.
|
* Collects settings that control the building of effective settings.
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface SettingsBuilderRequest
|
public interface SettingsBuilderRequest {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
@ -75,97 +72,82 @@ public interface SettingsBuilderRequest
|
||||||
Optional<Source> getUserSettingsSource();
|
Optional<Source> getUserSettingsSource();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static SettingsBuilderRequest build( @Nonnull Session session,
|
static SettingsBuilderRequest build(
|
||||||
@Nonnull Source globalSettingsSource,
|
@Nonnull Session session, @Nonnull Source globalSettingsSource, @Nonnull Source userSettingsSource) {
|
||||||
@Nonnull Source userSettingsSource )
|
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.globalSettingsSource( nonNull( globalSettingsSource, "globalSettingsSource cannot be null" ) )
|
.globalSettingsSource(nonNull(globalSettingsSource, "globalSettingsSource cannot be null"))
|
||||||
.userSettingsSource( nonNull( userSettingsSource, "userSettingsSource cannot be null" ) )
|
.userSettingsSource(nonNull(userSettingsSource, "userSettingsSource cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static SettingsBuilderRequest build( @Nonnull Session session,
|
static SettingsBuilderRequest build(
|
||||||
@Nonnull Path globalSettingsPath,
|
@Nonnull Session session, @Nonnull Path globalSettingsPath, @Nonnull Path userSettingsPath) {
|
||||||
@Nonnull Path userSettingsPath )
|
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.globalSettingsPath( nonNull( globalSettingsPath, "globalSettingsPath cannot be null" ) )
|
.globalSettingsPath(nonNull(globalSettingsPath, "globalSettingsPath cannot be null"))
|
||||||
.userSettingsPath( nonNull( userSettingsPath, "userSettingsPath cannot be null" ) )
|
.userSettingsPath(nonNull(userSettingsPath, "userSettingsPath cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static SettingsBuilderRequestBuilder builder()
|
static SettingsBuilderRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new SettingsBuilderRequestBuilder();
|
return new SettingsBuilderRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class SettingsBuilderRequestBuilder
|
class SettingsBuilderRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
Path globalSettingsPath;
|
Path globalSettingsPath;
|
||||||
Source globalSettingsSource;
|
Source globalSettingsSource;
|
||||||
Path userSettingsPath;
|
Path userSettingsPath;
|
||||||
Source userSettingsSource;
|
Source userSettingsSource;
|
||||||
|
|
||||||
public SettingsBuilderRequestBuilder session( Session session )
|
public SettingsBuilderRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsBuilderRequestBuilder globalSettingsPath( Path globalSettingsPath )
|
public SettingsBuilderRequestBuilder globalSettingsPath(Path globalSettingsPath) {
|
||||||
{
|
|
||||||
this.globalSettingsPath = globalSettingsPath;
|
this.globalSettingsPath = globalSettingsPath;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsBuilderRequestBuilder globalSettingsSource( Source globalSettingsSource )
|
public SettingsBuilderRequestBuilder globalSettingsSource(Source globalSettingsSource) {
|
||||||
{
|
|
||||||
this.globalSettingsSource = globalSettingsSource;
|
this.globalSettingsSource = globalSettingsSource;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsBuilderRequestBuilder userSettingsPath( Path userSettingsPath )
|
public SettingsBuilderRequestBuilder userSettingsPath(Path userSettingsPath) {
|
||||||
{
|
|
||||||
this.userSettingsPath = userSettingsPath;
|
this.userSettingsPath = userSettingsPath;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsBuilderRequestBuilder userSettingsSource( Source userSettingsSource )
|
public SettingsBuilderRequestBuilder userSettingsSource(Source userSettingsSource) {
|
||||||
{
|
|
||||||
this.userSettingsSource = userSettingsSource;
|
this.userSettingsSource = userSettingsSource;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsBuilderRequest build()
|
public SettingsBuilderRequest build() {
|
||||||
{
|
return new DefaultSettingsBuilderRequest(
|
||||||
return new DefaultSettingsBuilderRequest( session,
|
session, globalSettingsPath, globalSettingsSource, userSettingsPath, userSettingsSource);
|
||||||
globalSettingsPath, globalSettingsSource,
|
|
||||||
userSettingsPath, userSettingsSource );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultSettingsBuilderRequest extends BaseRequest
|
private static class DefaultSettingsBuilderRequest extends BaseRequest implements SettingsBuilderRequest {
|
||||||
implements SettingsBuilderRequest
|
|
||||||
{
|
|
||||||
private final Path globalSettingsPath;
|
private final Path globalSettingsPath;
|
||||||
private final Source globalSettingsSource;
|
private final Source globalSettingsSource;
|
||||||
private final Path userSettingsPath;
|
private final Path userSettingsPath;
|
||||||
private final Source userSettingsSource;
|
private final Source userSettingsSource;
|
||||||
|
|
||||||
@SuppressWarnings( "checkstyle:ParameterNumber" )
|
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||||
DefaultSettingsBuilderRequest( @Nonnull Session session,
|
DefaultSettingsBuilderRequest(
|
||||||
@Nullable Path globalSettingsPath,
|
@Nonnull Session session,
|
||||||
@Nullable Source globalSettingsSource,
|
@Nullable Path globalSettingsPath,
|
||||||
@Nullable Path userSettingsPath,
|
@Nullable Source globalSettingsSource,
|
||||||
@Nullable Source userSettingsSource )
|
@Nullable Path userSettingsPath,
|
||||||
{
|
@Nullable Source userSettingsSource) {
|
||||||
super( session );
|
super(session);
|
||||||
this.globalSettingsPath = globalSettingsPath;
|
this.globalSettingsPath = globalSettingsPath;
|
||||||
this.globalSettingsSource = globalSettingsSource;
|
this.globalSettingsSource = globalSettingsSource;
|
||||||
this.userSettingsPath = userSettingsPath;
|
this.userSettingsPath = userSettingsPath;
|
||||||
|
@ -174,30 +156,26 @@ public interface SettingsBuilderRequest
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Path> getGlobalSettingsPath()
|
public Optional<Path> getGlobalSettingsPath() {
|
||||||
{
|
return Optional.ofNullable(globalSettingsPath);
|
||||||
return Optional.ofNullable( globalSettingsPath );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Source> getGlobalSettingsSource()
|
public Optional<Source> getGlobalSettingsSource() {
|
||||||
{
|
return Optional.ofNullable(globalSettingsSource);
|
||||||
return Optional.ofNullable( globalSettingsSource );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Path> getUserSettingsPath()
|
public Optional<Path> getUserSettingsPath() {
|
||||||
{
|
return Optional.ofNullable(userSettingsPath);
|
||||||
return Optional.ofNullable( userSettingsPath );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Source> getUserSettingsSource()
|
public Optional<Source> getUserSettingsSource() {
|
||||||
{
|
return Optional.ofNullable(userSettingsSource);
|
||||||
return Optional.ofNullable( userSettingsSource );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,14 +16,13 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.settings.Settings;
|
import org.apache.maven.api.settings.Settings;
|
||||||
|
|
||||||
public interface SettingsBuilderResult
|
public interface SettingsBuilderResult {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the assembled settings.
|
* Gets the assembled settings.
|
||||||
|
@ -44,5 +41,4 @@ public interface SettingsBuilderResult
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
List<BuilderProblem> getProblems();
|
List<BuilderProblem> getProblems();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,10 +16,10 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,8 +28,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface Source
|
public interface Source {
|
||||||
{
|
|
||||||
InputStream getInputStream() throws IOException;
|
InputStream getInputStream() throws IOException;
|
||||||
|
|
||||||
String getLocation();
|
String getLocation();
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Consumer;
|
import org.apache.maven.api.annotations.Consumer;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -27,7 +26,6 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Consumer
|
@Consumer
|
||||||
public interface ToolchainFactory
|
public interface ToolchainFactory {
|
||||||
{
|
|
||||||
// TODO: implement ToolchainFactory
|
// TODO: implement ToolchainFactory
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,11 +16,11 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.Toolchain;
|
import org.apache.maven.api.Toolchain;
|
||||||
|
@ -35,8 +33,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ToolchainManager extends Service
|
public interface ToolchainManager extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -47,7 +44,7 @@ public interface ToolchainManager extends Service
|
||||||
* @throws ToolchainManagerException if an exception occurs
|
* @throws ToolchainManagerException if an exception occurs
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
List<Toolchain> getToolchains( @Nonnull Session session, String type, Map<String, String> requirements );
|
List<Toolchain> getToolchains(@Nonnull Session session, String type, Map<String, String> requirements);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -57,7 +54,7 @@ public interface ToolchainManager extends Service
|
||||||
* @throws ToolchainManagerException if an exception occurs
|
* @throws ToolchainManagerException if an exception occurs
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Optional<Toolchain> getToolchainFromBuildContext( @Nonnull Session session, String type )
|
Optional<Toolchain> getToolchainFromBuildContext(@Nonnull Session session, String type)
|
||||||
throws ToolchainManagerException;
|
throws ToolchainManagerException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,8 +65,7 @@ public interface ToolchainManager extends Service
|
||||||
* @throws ToolchainManagerException if an exception occurs
|
* @throws ToolchainManagerException if an exception occurs
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
List<Toolchain> getToolchainsForType( @Nonnull Session session, String type )
|
List<Toolchain> getToolchainsForType(@Nonnull Session session, String type) throws ToolchainManagerException;
|
||||||
throws ToolchainManagerException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -77,6 +73,5 @@ public interface ToolchainManager extends Service
|
||||||
* @param toolchain
|
* @param toolchain
|
||||||
* @throws ToolchainManagerException if an exception occurs
|
* @throws ToolchainManagerException if an exception occurs
|
||||||
*/
|
*/
|
||||||
void storeToolchainToBuildContext( @Nonnull Session session, Toolchain toolchain )
|
void storeToolchainToBuildContext(@Nonnull Session session, Toolchain toolchain) throws ToolchainManagerException;
|
||||||
throws ToolchainManagerException;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,12 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ToolchainManagerException
|
public class ToolchainManagerException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public ToolchainManagerException( String message, Exception e )
|
public ToolchainManagerException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
@ -26,9 +25,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* Builds the effective toolchains from a user toolchains file and/or a global toolchains file.
|
* Builds the effective toolchains from a user toolchains file and/or a global toolchains file.
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
|
public interface ToolchainsBuilder extends Service {
|
||||||
public interface ToolchainsBuilder extends Service
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the effective toolchains of the specified toolchains files.
|
* Builds the effective toolchains of the specified toolchains files.
|
||||||
|
@ -37,6 +34,5 @@ public interface ToolchainsBuilder extends Service
|
||||||
* @return the result of the toolchains building, never {@code null}
|
* @return the result of the toolchains building, never {@code null}
|
||||||
* @throws ToolchainsBuilderException if the effective toolchains could not be built
|
* @throws ToolchainsBuilderException if the effective toolchains could not be built
|
||||||
*/
|
*/
|
||||||
ToolchainsBuilderResult build( ToolchainsBuilderRequest request );
|
ToolchainsBuilderResult build(ToolchainsBuilderRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,13 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class ToolchainsBuilderException
|
public class ToolchainsBuilderException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public ToolchainsBuilderException( String message, Exception e )
|
public ToolchainsBuilderException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: add ToolchainsBuilderResult
|
// TODO: add ToolchainsBuilderResult
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,19 +16,18 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
|
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.maven.api.Session;
|
import org.apache.maven.api.Session;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.annotations.NotThreadSafe;
|
import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
import org.apache.maven.api.annotations.Nullable;
|
import org.apache.maven.api.annotations.Nullable;
|
||||||
|
|
||||||
import static org.apache.maven.api.services.BaseRequest.nonNull;
|
public interface ToolchainsBuilderRequest {
|
||||||
|
|
||||||
public interface ToolchainsBuilderRequest
|
|
||||||
{
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Session getSession();
|
Session getSession();
|
||||||
|
|
||||||
|
@ -67,97 +64,82 @@ public interface ToolchainsBuilderRequest
|
||||||
Optional<Source> getUserToolchainsSource();
|
Optional<Source> getUserToolchainsSource();
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ToolchainsBuilderRequest build( @Nonnull Session session,
|
static ToolchainsBuilderRequest build(
|
||||||
@Nonnull Source globalToolchainsSource,
|
@Nonnull Session session, @Nonnull Source globalToolchainsSource, @Nonnull Source userToolchainsSource) {
|
||||||
@Nonnull Source userToolchainsSource )
|
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.globalToolchainsSource( nonNull( globalToolchainsSource, "globalToolchainsSource cannot be null" ) )
|
.globalToolchainsSource(nonNull(globalToolchainsSource, "globalToolchainsSource cannot be null"))
|
||||||
.userToolchainsSource( nonNull( userToolchainsSource, "userToolchainsSource cannot be null" ) )
|
.userToolchainsSource(nonNull(userToolchainsSource, "userToolchainsSource cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ToolchainsBuilderRequest build( @Nonnull Session session,
|
static ToolchainsBuilderRequest build(
|
||||||
@Nonnull Path globalToolchainsPath,
|
@Nonnull Session session, @Nonnull Path globalToolchainsPath, @Nonnull Path userToolchainsPath) {
|
||||||
@Nonnull Path userToolchainsPath )
|
|
||||||
{
|
|
||||||
return builder()
|
return builder()
|
||||||
.session( nonNull( session, "session cannot be null" ) )
|
.session(nonNull(session, "session cannot be null"))
|
||||||
.globalToolchainsPath( nonNull( globalToolchainsPath, "globalToolchainsPath cannot be null" ) )
|
.globalToolchainsPath(nonNull(globalToolchainsPath, "globalToolchainsPath cannot be null"))
|
||||||
.userToolchainsPath( nonNull( userToolchainsPath, "userToolchainsPath cannot be null" ) )
|
.userToolchainsPath(nonNull(userToolchainsPath, "userToolchainsPath cannot be null"))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static ToolchainsBuilderRequestBuilder builder()
|
static ToolchainsBuilderRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new ToolchainsBuilderRequestBuilder();
|
return new ToolchainsBuilderRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class ToolchainsBuilderRequestBuilder
|
class ToolchainsBuilderRequestBuilder {
|
||||||
{
|
|
||||||
Session session;
|
Session session;
|
||||||
Path globalToolchainsPath;
|
Path globalToolchainsPath;
|
||||||
Source globalToolchainsSource;
|
Source globalToolchainsSource;
|
||||||
Path userToolchainsPath;
|
Path userToolchainsPath;
|
||||||
Source userToolchainsSource;
|
Source userToolchainsSource;
|
||||||
|
|
||||||
public ToolchainsBuilderRequestBuilder session( Session session )
|
public ToolchainsBuilderRequestBuilder session(Session session) {
|
||||||
{
|
|
||||||
this.session = session;
|
this.session = session;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolchainsBuilderRequestBuilder globalToolchainsPath( Path globalToolchainsPath )
|
public ToolchainsBuilderRequestBuilder globalToolchainsPath(Path globalToolchainsPath) {
|
||||||
{
|
|
||||||
this.globalToolchainsPath = globalToolchainsPath;
|
this.globalToolchainsPath = globalToolchainsPath;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolchainsBuilderRequestBuilder globalToolchainsSource( Source globalToolchainsSource )
|
public ToolchainsBuilderRequestBuilder globalToolchainsSource(Source globalToolchainsSource) {
|
||||||
{
|
|
||||||
this.globalToolchainsSource = globalToolchainsSource;
|
this.globalToolchainsSource = globalToolchainsSource;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolchainsBuilderRequestBuilder userToolchainsPath( Path userToolchainsPath )
|
public ToolchainsBuilderRequestBuilder userToolchainsPath(Path userToolchainsPath) {
|
||||||
{
|
|
||||||
this.userToolchainsPath = userToolchainsPath;
|
this.userToolchainsPath = userToolchainsPath;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolchainsBuilderRequestBuilder userToolchainsSource( Source userToolchainsSource )
|
public ToolchainsBuilderRequestBuilder userToolchainsSource(Source userToolchainsSource) {
|
||||||
{
|
|
||||||
this.userToolchainsSource = userToolchainsSource;
|
this.userToolchainsSource = userToolchainsSource;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ToolchainsBuilderRequest build()
|
public ToolchainsBuilderRequest build() {
|
||||||
{
|
return new ToolchainsBuilderRequestBuilder.DefaultToolchainsBuilderRequest(
|
||||||
return new ToolchainsBuilderRequestBuilder.DefaultToolchainsBuilderRequest( session,
|
session, globalToolchainsPath, globalToolchainsSource, userToolchainsPath, userToolchainsSource);
|
||||||
globalToolchainsPath, globalToolchainsSource,
|
|
||||||
userToolchainsPath, userToolchainsSource );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultToolchainsBuilderRequest extends BaseRequest
|
private static class DefaultToolchainsBuilderRequest extends BaseRequest implements ToolchainsBuilderRequest {
|
||||||
implements ToolchainsBuilderRequest
|
|
||||||
{
|
|
||||||
private final Path globalToolchainsPath;
|
private final Path globalToolchainsPath;
|
||||||
private final Source globalToolchainsSource;
|
private final Source globalToolchainsSource;
|
||||||
private final Path userToolchainsPath;
|
private final Path userToolchainsPath;
|
||||||
private final Source userToolchainsSource;
|
private final Source userToolchainsSource;
|
||||||
|
|
||||||
@SuppressWarnings( "checkstyle:ParameterNumber" )
|
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||||
DefaultToolchainsBuilderRequest( @Nonnull Session session,
|
DefaultToolchainsBuilderRequest(
|
||||||
@Nullable Path globalToolchainsPath,
|
@Nonnull Session session,
|
||||||
@Nullable Source globalToolchainsSource,
|
@Nullable Path globalToolchainsPath,
|
||||||
@Nullable Path userToolchainsPath,
|
@Nullable Source globalToolchainsSource,
|
||||||
@Nullable Source userToolchainsSource )
|
@Nullable Path userToolchainsPath,
|
||||||
{
|
@Nullable Source userToolchainsSource) {
|
||||||
super( session );
|
super(session);
|
||||||
this.globalToolchainsPath = globalToolchainsPath;
|
this.globalToolchainsPath = globalToolchainsPath;
|
||||||
this.globalToolchainsSource = globalToolchainsSource;
|
this.globalToolchainsSource = globalToolchainsSource;
|
||||||
this.userToolchainsPath = userToolchainsPath;
|
this.userToolchainsPath = userToolchainsPath;
|
||||||
|
@ -166,30 +148,26 @@ public interface ToolchainsBuilderRequest
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Path> getGlobalToolchainsPath()
|
public Optional<Path> getGlobalToolchainsPath() {
|
||||||
{
|
return Optional.ofNullable(globalToolchainsPath);
|
||||||
return Optional.ofNullable( globalToolchainsPath );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Source> getGlobalToolchainsSource()
|
public Optional<Source> getGlobalToolchainsSource() {
|
||||||
{
|
return Optional.ofNullable(globalToolchainsSource);
|
||||||
return Optional.ofNullable( globalToolchainsSource );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Path> getUserToolchainsPath()
|
public Optional<Path> getUserToolchainsPath() {
|
||||||
{
|
return Optional.ofNullable(userToolchainsPath);
|
||||||
return Optional.ofNullable( userToolchainsPath );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<Source> getUserToolchainsSource()
|
public Optional<Source> getUserToolchainsSource() {
|
||||||
{
|
return Optional.ofNullable(userToolchainsSource);
|
||||||
return Optional.ofNullable( userToolchainsSource );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,14 +16,13 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.toolchain.PersistedToolchains;
|
import org.apache.maven.api.toolchain.PersistedToolchains;
|
||||||
|
|
||||||
public interface ToolchainsBuilderResult
|
public interface ToolchainsBuilderResult {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Gets the assembled toolchains.
|
* Gets the assembled toolchains.
|
||||||
*
|
*
|
||||||
|
@ -43,5 +40,4 @@ public interface ToolchainsBuilderResult
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
List<BuilderProblem> getProblems();
|
List<BuilderProblem> getProblems();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Type;
|
import org.apache.maven.api.Type;
|
||||||
|
@ -30,8 +29,7 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface TypeRegistry extends Service
|
public interface TypeRegistry extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the {@link Type} from the specified {@code id}.
|
* Obtain the {@link Type} from the specified {@code id}.
|
||||||
|
@ -42,6 +40,5 @@ public interface TypeRegistry extends Service
|
||||||
* @return the type
|
* @return the type
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Type getType( @Nonnull String id );
|
Type getType(@Nonnull String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.Service;
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.Version;
|
import org.apache.maven.api.Version;
|
||||||
|
@ -27,22 +26,21 @@ import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service interface to parse {@link Version} and {@link VersionRange}.
|
* Service interface to parse {@link Version} and {@link VersionRange}.
|
||||||
*
|
*
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface VersionParser extends Service
|
public interface VersionParser extends Service {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Parses the specified version string, for example "1.0".
|
* Parses the specified version string, for example "1.0".
|
||||||
*
|
*
|
||||||
* @param version the version string to parse, must not be {@code null}
|
* @param version the version string to parse, must not be {@code null}
|
||||||
* @return the parsed version, never {@code null}
|
* @return the parsed version, never {@code null}
|
||||||
* @throws VersionParserException if the string violates the syntax rules of this scheme
|
* @throws VersionParserException if the string violates the syntax rules of this scheme
|
||||||
* @see org.apache.maven.api.Session#parseVersion(String)
|
* @see org.apache.maven.api.Session#parseVersion(String)
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
Version parseVersion( @Nonnull String version );
|
Version parseVersion(@Nonnull String version);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the specified version range specification, for example "[1.0,2.0)".
|
* Parses the specified version range specification, for example "[1.0,2.0)".
|
||||||
|
@ -52,11 +50,10 @@ public interface VersionParser extends Service
|
||||||
* @throws VersionParserException if the range specification violates the syntax rules of this scheme
|
* @throws VersionParserException if the range specification violates the syntax rules of this scheme
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
VersionRange parseVersionRange( @Nonnull String range );
|
VersionRange parseVersionRange(@Nonnull String range);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a given artifact version is considered a {@code SNAPSHOT} or not.
|
* Checks whether a given artifact version is considered a {@code SNAPSHOT} or not.
|
||||||
*/
|
*/
|
||||||
boolean isSnapshot( @Nonnull String version );
|
boolean isSnapshot(@Nonnull String version);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
|
@ -27,16 +26,12 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class VersionParserException
|
public class VersionParserException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param message the message to give
|
* @param message the message to give
|
||||||
* @param e the {@link Exception}
|
* @param e the {@link Exception}
|
||||||
*/
|
*/
|
||||||
public VersionParserException( String message, Exception e )
|
public VersionParserException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.model.Model;
|
import org.apache.maven.api.model.Model;
|
||||||
|
@ -28,7 +27,4 @@ import org.apache.maven.api.model.Model;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ModelXmlFactory extends XmlFactory<Model>
|
public interface ModelXmlFactory extends XmlFactory<Model> {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.settings.Settings;
|
import org.apache.maven.api.settings.Settings;
|
||||||
|
@ -28,7 +27,4 @@ import org.apache.maven.api.settings.Settings;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface SettingsXmlFactory extends XmlFactory<Settings>
|
public interface SettingsXmlFactory extends XmlFactory<Settings> {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.toolchain.PersistedToolchains;
|
import org.apache.maven.api.toolchain.PersistedToolchains;
|
||||||
|
@ -28,7 +27,4 @@ import org.apache.maven.api.toolchain.PersistedToolchains;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface ToolchainsXmlFactory extends XmlFactory<PersistedToolchains>
|
public interface ToolchainsXmlFactory extends XmlFactory<PersistedToolchains> {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -26,10 +25,9 @@ import java.io.StringReader;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import org.apache.maven.api.Service;
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
import org.apache.maven.api.Service;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic interface to read/write objects to/from XML.
|
* Generic interface to read/write objects to/from XML.
|
||||||
|
@ -38,91 +36,81 @@ import org.apache.maven.api.Service;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface XmlFactory<T> extends Service
|
public interface XmlFactory<T> extends Service {
|
||||||
{
|
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull Path path ) throws XmlReaderException
|
default T read(@Nonnull Path path) throws XmlReaderException {
|
||||||
{
|
return read(path, true);
|
||||||
return read( path, true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull Path path, boolean strict ) throws XmlReaderException
|
default T read(@Nonnull Path path, boolean strict) throws XmlReaderException {
|
||||||
{
|
return read(XmlReaderRequest.builder().path(path).strict(strict).build());
|
||||||
return read( XmlReaderRequest.builder().path( path ).strict( strict ).build() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull InputStream input ) throws XmlReaderException
|
default T read(@Nonnull InputStream input) throws XmlReaderException {
|
||||||
{
|
return read(input, true);
|
||||||
return read( input, true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull InputStream input, boolean strict ) throws XmlReaderException
|
default T read(@Nonnull InputStream input, boolean strict) throws XmlReaderException {
|
||||||
{
|
return read(XmlReaderRequest.builder().inputStream(input).strict(strict).build());
|
||||||
return read( XmlReaderRequest.builder().inputStream( input ).strict( strict ).build() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull Reader reader ) throws XmlReaderException
|
default T read(@Nonnull Reader reader) throws XmlReaderException {
|
||||||
{
|
return read(reader, true);
|
||||||
return read( reader, true );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
default T read( @Nonnull Reader reader, boolean strict ) throws XmlReaderException
|
default T read(@Nonnull Reader reader, boolean strict) throws XmlReaderException {
|
||||||
{
|
return read(XmlReaderRequest.builder().reader(reader).strict(strict).build());
|
||||||
return read( XmlReaderRequest.builder().reader( reader ).strict( strict ).build() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
T read( @Nonnull XmlReaderRequest request ) throws XmlReaderException;
|
T read(@Nonnull XmlReaderRequest request) throws XmlReaderException;
|
||||||
|
|
||||||
default void write( @Nonnull T content, @Nonnull Path path ) throws XmlWriterException
|
default void write(@Nonnull T content, @Nonnull Path path) throws XmlWriterException {
|
||||||
{
|
write(XmlWriterRequest.<T>builder().content(content).path(path).build());
|
||||||
write( XmlWriterRequest.<T>builder().content( content ).path( path ).build() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
default void write( @Nonnull T content, @Nonnull OutputStream outputStream ) throws XmlWriterException
|
default void write(@Nonnull T content, @Nonnull OutputStream outputStream) throws XmlWriterException {
|
||||||
{
|
write(XmlWriterRequest.<T>builder()
|
||||||
write( XmlWriterRequest.<T>builder().content( content ).outputStream( outputStream ).build() );
|
.content(content)
|
||||||
|
.outputStream(outputStream)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
default void write( @Nonnull T content, @Nonnull Writer writer ) throws XmlWriterException
|
default void write(@Nonnull T content, @Nonnull Writer writer) throws XmlWriterException {
|
||||||
{
|
write(XmlWriterRequest.<T>builder().content(content).writer(writer).build());
|
||||||
write( XmlWriterRequest.<T>builder().content( content ).writer( writer ).build() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void write( @Nonnull XmlWriterRequest<T> request ) throws XmlWriterException;
|
void write(@Nonnull XmlWriterRequest<T> request) throws XmlWriterException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply parse the given xml string.
|
* Simply parse the given xml string.
|
||||||
*
|
*
|
||||||
* @param xml the input xml string
|
* @param xml the input xml string
|
||||||
* @return the parsed object
|
* @return the parsed object
|
||||||
* @throws XmlReaderException if an error occurs during the parsing
|
* @throws XmlReaderException if an error occurs during the parsing
|
||||||
* @see #toXmlString(Object)
|
* @see #toXmlString(Object)
|
||||||
*/
|
*/
|
||||||
default T fromXmlString( @Nonnull String xml ) throws XmlReaderException
|
default T fromXmlString(@Nonnull String xml) throws XmlReaderException {
|
||||||
{
|
return read(new StringReader(xml));
|
||||||
return read( new StringReader( xml ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply converts the given content to an xml string.
|
* Simply converts the given content to an xml string.
|
||||||
*
|
*
|
||||||
* @param content the object to convert
|
* @param content the object to convert
|
||||||
* @return the xml string representation
|
* @return the xml string representation
|
||||||
* @throws XmlWriterException if an error occurs during the transformation
|
* @throws XmlWriterException if an error occurs during the transformation
|
||||||
* @see #fromXmlString(String)
|
* @see #fromXmlString(String)
|
||||||
*/
|
*/
|
||||||
default String toXmlString( @Nonnull T content ) throws XmlWriterException
|
default String toXmlString(@Nonnull T content) throws XmlWriterException {
|
||||||
{
|
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
write( content, sw );
|
write(content, sw);
|
||||||
return sw.toString();
|
return sw.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.services.MavenException;
|
import org.apache.maven.api.services.MavenException;
|
||||||
|
@ -28,17 +27,13 @@ import org.apache.maven.api.services.MavenException;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class XmlReaderException
|
public class XmlReaderException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param message the message for the exception
|
* @param message the message for the exception
|
||||||
* @param e the exception itself
|
* @param e the exception itself
|
||||||
*/
|
*/
|
||||||
public XmlReaderException( String message, Exception e )
|
public XmlReaderException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,12 +16,12 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.annotations.Immutable;
|
import org.apache.maven.api.annotations.Immutable;
|
||||||
import org.apache.maven.api.annotations.Nonnull;
|
import org.apache.maven.api.annotations.Nonnull;
|
||||||
|
@ -36,8 +34,7 @@ import org.apache.maven.api.annotations.NotThreadSafe;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Immutable
|
@Immutable
|
||||||
public interface XmlReaderRequest
|
public interface XmlReaderRequest {
|
||||||
{
|
|
||||||
|
|
||||||
Path getPath();
|
Path getPath();
|
||||||
|
|
||||||
|
@ -57,8 +54,7 @@ public interface XmlReaderRequest
|
||||||
|
|
||||||
boolean isAddDefaultEntities();
|
boolean isAddDefaultEntities();
|
||||||
|
|
||||||
interface Transformer
|
interface Transformer {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Interpolate the value read from the xml document
|
* Interpolate the value read from the xml document
|
||||||
*
|
*
|
||||||
|
@ -67,18 +63,16 @@ public interface XmlReaderRequest
|
||||||
* log stuff.
|
* log stuff.
|
||||||
* @return the interpolated value
|
* @return the interpolated value
|
||||||
*/
|
*/
|
||||||
String transform( String source, String fieldName );
|
String transform(String source, String fieldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
static XmlReaderRequestBuilder builder()
|
static XmlReaderRequestBuilder builder() {
|
||||||
{
|
|
||||||
return new XmlReaderRequestBuilder();
|
return new XmlReaderRequestBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotThreadSafe
|
@NotThreadSafe
|
||||||
class XmlReaderRequestBuilder
|
class XmlReaderRequestBuilder {
|
||||||
{
|
|
||||||
Path path;
|
Path path;
|
||||||
URL url;
|
URL url;
|
||||||
InputStream inputStream;
|
InputStream inputStream;
|
||||||
|
@ -89,68 +83,57 @@ public interface XmlReaderRequest
|
||||||
String location;
|
String location;
|
||||||
boolean addDefaultEntities = true;
|
boolean addDefaultEntities = true;
|
||||||
|
|
||||||
public XmlReaderRequestBuilder path( Path path )
|
public XmlReaderRequestBuilder path(Path path) {
|
||||||
{
|
|
||||||
this.path = path;
|
this.path = path;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder url( URL url )
|
public XmlReaderRequestBuilder url(URL url) {
|
||||||
{
|
|
||||||
this.url = url;
|
this.url = url;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder inputStream( InputStream inputStream )
|
public XmlReaderRequestBuilder inputStream(InputStream inputStream) {
|
||||||
{
|
|
||||||
this.inputStream = inputStream;
|
this.inputStream = inputStream;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder reader( Reader reader )
|
public XmlReaderRequestBuilder reader(Reader reader) {
|
||||||
{
|
|
||||||
this.reader = reader;
|
this.reader = reader;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder transformer( Transformer transformer )
|
public XmlReaderRequestBuilder transformer(Transformer transformer) {
|
||||||
{
|
|
||||||
this.transformer = transformer;
|
this.transformer = transformer;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder strict( boolean strict )
|
public XmlReaderRequestBuilder strict(boolean strict) {
|
||||||
{
|
|
||||||
this.strict = strict;
|
this.strict = strict;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder modelId( String modelId )
|
public XmlReaderRequestBuilder modelId(String modelId) {
|
||||||
{
|
|
||||||
this.modelId = modelId;
|
this.modelId = modelId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder location( String location )
|
public XmlReaderRequestBuilder location(String location) {
|
||||||
{
|
|
||||||
this.location = location;
|
this.location = location;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequestBuilder addDefaultEntities( boolean addDefaultEntities )
|
public XmlReaderRequestBuilder addDefaultEntities(boolean addDefaultEntities) {
|
||||||
{
|
|
||||||
this.addDefaultEntities = addDefaultEntities;
|
this.addDefaultEntities = addDefaultEntities;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlReaderRequest build()
|
public XmlReaderRequest build() {
|
||||||
{
|
return new DefaultXmlReaderRequest(
|
||||||
return new DefaultXmlReaderRequest( path, url, inputStream, reader, transformer, strict,
|
path, url, inputStream, reader, transformer, strict, modelId, location, addDefaultEntities);
|
||||||
modelId, location, addDefaultEntities );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultXmlReaderRequest implements XmlReaderRequest
|
private static class DefaultXmlReaderRequest implements XmlReaderRequest {
|
||||||
{
|
|
||||||
final Path path;
|
final Path path;
|
||||||
final URL url;
|
final URL url;
|
||||||
final InputStream inputStream;
|
final InputStream inputStream;
|
||||||
|
@ -161,12 +144,17 @@ public interface XmlReaderRequest
|
||||||
final String location;
|
final String location;
|
||||||
final boolean addDefaultEntities;
|
final boolean addDefaultEntities;
|
||||||
|
|
||||||
@SuppressWarnings( "checkstyle:ParameterNumber" )
|
@SuppressWarnings("checkstyle:ParameterNumber")
|
||||||
DefaultXmlReaderRequest( Path path, URL url, InputStream inputStream, Reader reader,
|
DefaultXmlReaderRequest(
|
||||||
Transformer transformer, boolean strict,
|
Path path,
|
||||||
String modelId, String location,
|
URL url,
|
||||||
boolean addDefaultEntities )
|
InputStream inputStream,
|
||||||
{
|
Reader reader,
|
||||||
|
Transformer transformer,
|
||||||
|
boolean strict,
|
||||||
|
String modelId,
|
||||||
|
String location,
|
||||||
|
boolean addDefaultEntities) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
this.inputStream = inputStream;
|
this.inputStream = inputStream;
|
||||||
|
@ -179,58 +167,48 @@ public interface XmlReaderRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Path getPath()
|
public Path getPath() {
|
||||||
{
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public URL getURL()
|
public URL getURL() {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getInputStream()
|
public InputStream getInputStream() {
|
||||||
{
|
|
||||||
return inputStream;
|
return inputStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Reader getReader()
|
public Reader getReader() {
|
||||||
{
|
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Transformer getTransformer()
|
public Transformer getTransformer() {
|
||||||
{
|
|
||||||
return transformer;
|
return transformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isStrict()
|
public boolean isStrict() {
|
||||||
{
|
|
||||||
return strict;
|
return strict;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModelId()
|
public String getModelId() {
|
||||||
{
|
|
||||||
return modelId;
|
return modelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLocation()
|
public String getLocation() {
|
||||||
{
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAddDefaultEntities()
|
public boolean isAddDefaultEntities() {
|
||||||
{
|
|
||||||
return addDefaultEntities;
|
return addDefaultEntities;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
import org.apache.maven.api.services.MavenException;
|
import org.apache.maven.api.services.MavenException;
|
||||||
|
@ -28,17 +27,13 @@ import org.apache.maven.api.services.MavenException;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public class XmlWriterException
|
public class XmlWriterException extends MavenException {
|
||||||
extends MavenException
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param message the message for the exception
|
* @param message the message for the exception
|
||||||
* @param e the exception itself
|
* @param e the exception itself
|
||||||
*/
|
*/
|
||||||
public XmlWriterException( String message, Exception e )
|
public XmlWriterException(String message, Exception e) {
|
||||||
{
|
super(message, e);
|
||||||
super( message, e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.services.xml;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.services.xml;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,11 +16,11 @@ package org.apache.maven.api.services.xml;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.services.xml;
|
||||||
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import org.apache.maven.api.annotations.Experimental;
|
import org.apache.maven.api.annotations.Experimental;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,8 +30,7 @@ import org.apache.maven.api.annotations.Experimental;
|
||||||
* @param <T> the object type to read
|
* @param <T> the object type to read
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
public interface XmlWriterRequest<T>
|
public interface XmlWriterRequest<T> {
|
||||||
{
|
|
||||||
|
|
||||||
Path getPath();
|
Path getPath();
|
||||||
|
|
||||||
|
@ -43,56 +40,47 @@ public interface XmlWriterRequest<T>
|
||||||
|
|
||||||
T getContent();
|
T getContent();
|
||||||
|
|
||||||
static <T> XmlWriterRequestBuilder<T> builder()
|
static <T> XmlWriterRequestBuilder<T> builder() {
|
||||||
{
|
|
||||||
return new XmlWriterRequestBuilder<>();
|
return new XmlWriterRequestBuilder<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
class XmlWriterRequestBuilder<T>
|
class XmlWriterRequestBuilder<T> {
|
||||||
{
|
|
||||||
Path path;
|
Path path;
|
||||||
OutputStream outputStream;
|
OutputStream outputStream;
|
||||||
Writer writer;
|
Writer writer;
|
||||||
T content;
|
T content;
|
||||||
|
|
||||||
public XmlWriterRequestBuilder<T> path( Path path )
|
public XmlWriterRequestBuilder<T> path(Path path) {
|
||||||
{
|
|
||||||
this.path = path;
|
this.path = path;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlWriterRequestBuilder<T> outputStream( OutputStream outputStream )
|
public XmlWriterRequestBuilder<T> outputStream(OutputStream outputStream) {
|
||||||
{
|
|
||||||
this.outputStream = outputStream;
|
this.outputStream = outputStream;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlWriterRequestBuilder<T> writer( Writer writer )
|
public XmlWriterRequestBuilder<T> writer(Writer writer) {
|
||||||
{
|
|
||||||
this.writer = writer;
|
this.writer = writer;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlWriterRequestBuilder<T> content( T content )
|
public XmlWriterRequestBuilder<T> content(T content) {
|
||||||
{
|
|
||||||
this.content = content;
|
this.content = content;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlWriterRequest<T> build()
|
public XmlWriterRequest<T> build() {
|
||||||
{
|
return new DefaultXmlWriterRequest<>(path, outputStream, writer, content);
|
||||||
return new DefaultXmlWriterRequest<>( path, outputStream, writer, content );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class DefaultXmlWriterRequest<T> implements XmlWriterRequest<T>
|
private static class DefaultXmlWriterRequest<T> implements XmlWriterRequest<T> {
|
||||||
{
|
|
||||||
final Path path;
|
final Path path;
|
||||||
final OutputStream outputStream;
|
final OutputStream outputStream;
|
||||||
final Writer writer;
|
final Writer writer;
|
||||||
final T content;
|
final T content;
|
||||||
|
|
||||||
DefaultXmlWriterRequest( Path path, OutputStream outputStream, Writer writer, T content )
|
DefaultXmlWriterRequest(Path path, OutputStream outputStream, Writer writer, T content) {
|
||||||
{
|
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.outputStream = outputStream;
|
this.outputStream = outputStream;
|
||||||
this.writer = writer;
|
this.writer = writer;
|
||||||
|
@ -100,26 +88,22 @@ public interface XmlWriterRequest<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Path getPath()
|
public Path getPath() {
|
||||||
{
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OutputStream getOutputStream()
|
public OutputStream getOutputStream() {
|
||||||
{
|
|
||||||
return outputStream;
|
return outputStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Writer getWriter()
|
public Writer getWriter() {
|
||||||
{
|
|
||||||
return writer;
|
return writer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T getContent()
|
public T getContent() {
|
||||||
{
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
or more contributor license agreements. See the NOTICE file
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
package org.apache.maven.api.annotations;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -9,7 +7,7 @@ package org.apache.maven.api.annotations;
|
||||||
* "License"); you may not use this file except in compliance
|
* "License"); you may not use this file except in compliance
|
||||||
* with the License. You may obtain a copy of the License at
|
* with the License. You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing,
|
* Unless required by applicable law or agreed to in writing,
|
||||||
* software distributed under the License is distributed on an
|
* software distributed under the License is distributed on an
|
||||||
|
@ -18,6 +16,7 @@ package org.apache.maven.api.annotations;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
package org.apache.maven.api.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
|
@ -40,8 +39,6 @@ import java.lang.annotation.Target;
|
||||||
*/
|
*/
|
||||||
@Experimental
|
@Experimental
|
||||||
@Documented
|
@Documented
|
||||||
@Retention( RetentionPolicy.CLASS )
|
@Retention(RetentionPolicy.CLASS)
|
||||||
@Target( { ElementType.TYPE, ElementType.PACKAGE } )
|
@Target({ElementType.TYPE, ElementType.PACKAGE})
|
||||||
public @interface Consumer
|
public @interface Consumer {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue