mirror of https://github.com/apache/maven.git
fixed errors reported by Checkstyle
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@958295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4e202d7d01
commit
23f2095652
|
@ -107,9 +107,9 @@ public final class ArtifactUtils
|
|||
return groupId + ":" + artifactId + ":" + version;
|
||||
}
|
||||
|
||||
public static Map<String,Artifact> artifactMapByVersionlessId( Collection<Artifact> artifacts )
|
||||
public static Map<String, Artifact> artifactMapByVersionlessId( Collection<Artifact> artifacts )
|
||||
{
|
||||
Map<String,Artifact> artifactMap = new LinkedHashMap<String,Artifact>();
|
||||
Map<String, Artifact> artifactMap = new LinkedHashMap<String, Artifact>();
|
||||
|
||||
if ( artifacts != null )
|
||||
{
|
||||
|
|
|
@ -77,21 +77,25 @@ public class DefaultArtifact
|
|||
|
||||
private List<ArtifactVersion> availableVersions;
|
||||
|
||||
private Map<Object,ArtifactMetadata> metadataMap;
|
||||
private Map<Object, ArtifactMetadata> metadataMap;
|
||||
|
||||
private boolean optional;
|
||||
|
||||
public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type, String classifier, ArtifactHandler artifactHandler )
|
||||
public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type,
|
||||
String classifier, ArtifactHandler artifactHandler )
|
||||
{
|
||||
this( groupId, artifactId, VersionRange.createFromVersion( version ), scope, type, classifier, artifactHandler, false );
|
||||
this( groupId, artifactId, VersionRange.createFromVersion( version ), scope, type, classifier, artifactHandler,
|
||||
false );
|
||||
}
|
||||
|
||||
public DefaultArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type, String classifier, ArtifactHandler artifactHandler )
|
||||
public DefaultArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type,
|
||||
String classifier, ArtifactHandler artifactHandler )
|
||||
{
|
||||
this( groupId, artifactId, versionRange, scope, type, classifier, artifactHandler, false );
|
||||
}
|
||||
|
||||
public DefaultArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type, String classifier, ArtifactHandler artifactHandler, boolean optional )
|
||||
public DefaultArtifact( String groupId, String artifactId, VersionRange versionRange, String scope, String type,
|
||||
String classifier, ArtifactHandler artifactHandler, boolean optional )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
|
||||
|
@ -247,7 +251,7 @@ public class DefaultArtifact
|
|||
{
|
||||
if ( metadataMap == null )
|
||||
{
|
||||
metadataMap = new HashMap<Object,ArtifactMetadata>();
|
||||
metadataMap = new HashMap<Object, ArtifactMetadata>();
|
||||
}
|
||||
|
||||
ArtifactMetadata m = metadataMap.get( metadata.getKey() );
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
package org.apache.maven.artifact.repository;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
|
@ -61,18 +66,18 @@ public interface ArtifactRepository
|
|||
|
||||
@Deprecated
|
||||
boolean isBlacklisted();
|
||||
|
||||
|
||||
@Deprecated
|
||||
void setBlacklisted( boolean blackListed );
|
||||
|
||||
//
|
||||
// New interface methods for the repository system.
|
||||
// New interface methods for the repository system.
|
||||
//
|
||||
Artifact find( Artifact artifact );
|
||||
|
||||
/**
|
||||
* Finds the versions of the specified artifact that are available in this repository.
|
||||
*
|
||||
*
|
||||
* @param artifact The artifact whose available versions should be determined, must not be {@code null}.
|
||||
* @return The available versions of the artifact or an empty list if none, never {@code null}.
|
||||
*/
|
||||
|
@ -81,14 +86,14 @@ public interface ArtifactRepository
|
|||
/**
|
||||
* Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace
|
||||
* are examples of such repositories.
|
||||
*
|
||||
*
|
||||
* @return {@code true} if the repository is backed by actual projects, {@code false} otherwise.
|
||||
*/
|
||||
boolean isProjectAware();
|
||||
|
||||
void setAuthentication( Authentication authentication );
|
||||
void setAuthentication( Authentication authentication );
|
||||
Authentication getAuthentication();
|
||||
|
||||
|
||||
void setProxy( Proxy proxy );
|
||||
Proxy getProxy();
|
||||
}
|
||||
|
|
|
@ -61,9 +61,7 @@ public class ArtifactRepositoryPolicy
|
|||
this( policy.isEnabled(), policy.getUpdatePolicy(), policy.getChecksumPolicy() );
|
||||
}
|
||||
|
||||
public ArtifactRepositoryPolicy( boolean enabled,
|
||||
String updatePolicy,
|
||||
String checksumPolicy )
|
||||
public ArtifactRepositoryPolicy( boolean enabled, String updatePolicy, String checksumPolicy )
|
||||
{
|
||||
this.enabled = enabled;
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package org.apache.maven.artifact.repository.layout;
|
||||
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -22,6 +19,9 @@ import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
||||
|
||||
public interface ArtifactRepositoryLayout2
|
||||
extends ArtifactRepositoryLayout
|
||||
{
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
package org.apache.maven.artifact.resolver;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
|
@ -35,30 +40,36 @@ public class ArtifactNotFoundException
|
|||
|
||||
public ArtifactNotFoundException( String message, Artifact artifact )
|
||||
{
|
||||
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact
|
||||
.getDependencyTrail() );
|
||||
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
|
||||
artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() );
|
||||
}
|
||||
|
||||
protected ArtifactNotFoundException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable cause )
|
||||
protected ArtifactNotFoundException( String message, Artifact artifact,
|
||||
List<ArtifactRepository> remoteRepositories, Throwable cause )
|
||||
{
|
||||
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact
|
||||
.getDependencyTrail(), cause );
|
||||
this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(),
|
||||
artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact.getDependencyTrail(),
|
||||
cause );
|
||||
}
|
||||
|
||||
public ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List<ArtifactRepository> remoteRepositories,
|
||||
public ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type,
|
||||
String classifier, List<ArtifactRepository> remoteRepositories,
|
||||
String downloadUrl, List<String> path, Throwable cause )
|
||||
{
|
||||
super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier, downloadUrl, path ), groupId, artifactId, version, type, classifier, remoteRepositories,
|
||||
null, cause );
|
||||
super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier,
|
||||
downloadUrl, path ), groupId, artifactId, version, type, classifier,
|
||||
remoteRepositories, null, cause );
|
||||
|
||||
this.downloadUrl = downloadUrl;
|
||||
}
|
||||
|
||||
private ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type, String classifier, List<ArtifactRepository> remoteRepositories,
|
||||
private ArtifactNotFoundException( String message, String groupId, String artifactId, String version, String type,
|
||||
String classifier, List<ArtifactRepository> remoteRepositories,
|
||||
String downloadUrl, List<String> path )
|
||||
{
|
||||
super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier, downloadUrl, path ), groupId, artifactId, version, type, classifier, remoteRepositories,
|
||||
null );
|
||||
super( constructMissingArtifactMessage( message, "", groupId, artifactId, version, type, classifier,
|
||||
downloadUrl, path ), groupId, artifactId, version, type, classifier,
|
||||
remoteRepositories, null );
|
||||
|
||||
this.downloadUrl = downloadUrl;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.resolver;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
@ -34,7 +38,8 @@ public class ArtifactResolutionException
|
|||
super( message, groupId, artifactId, version, type, classifier, remoteRepositories, path, t );
|
||||
}
|
||||
|
||||
public ArtifactResolutionException( String message, String groupId, String artifactId, String version, String type, String classifier, Throwable t )
|
||||
public ArtifactResolutionException( String message, String groupId, String artifactId, String version, String type,
|
||||
String classifier, Throwable t )
|
||||
{
|
||||
super( message, groupId, artifactId, version, type, classifier, null, null, t );
|
||||
}
|
||||
|
@ -54,7 +59,8 @@ public class ArtifactResolutionException
|
|||
super( message, artifact, null, cause );
|
||||
}
|
||||
|
||||
public ArtifactResolutionException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable cause )
|
||||
public ArtifactResolutionException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
Throwable cause )
|
||||
{
|
||||
super( message, artifact, remoteRepositories, cause );
|
||||
}
|
||||
|
|
|
@ -67,15 +67,15 @@ public class ComparableVersion
|
|||
|
||||
private interface Item
|
||||
{
|
||||
public static final int INTEGER_ITEM = 0;
|
||||
public static final int STRING_ITEM = 1;
|
||||
public static final int LIST_ITEM = 2;
|
||||
final int INTEGER_ITEM = 0;
|
||||
final int STRING_ITEM = 1;
|
||||
final int LIST_ITEM = 2;
|
||||
|
||||
public int compareTo( Item item );
|
||||
int compareTo( Item item );
|
||||
|
||||
public int getType();
|
||||
int getType();
|
||||
|
||||
public boolean isNull();
|
||||
boolean isNull();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +92,7 @@ public class ComparableVersion
|
|||
|
||||
private IntegerItem()
|
||||
{
|
||||
this.value = BigInteger_ZERO;
|
||||
this.value = BigInteger_ZERO;
|
||||
}
|
||||
|
||||
public IntegerItem( String str )
|
||||
|
@ -145,21 +145,23 @@ public class ComparableVersion
|
|||
private static class StringItem
|
||||
implements Item
|
||||
{
|
||||
private final static String[] QUALIFIERS = { "alpha", "beta", "milestone", "rc", "snapshot", "", "sp" };
|
||||
private static final String[] QUALIFIERS = { "alpha", "beta", "milestone", "rc", "snapshot", "", "sp" };
|
||||
|
||||
private final static List<String> _QUALIFIERS = Arrays.asList( QUALIFIERS );
|
||||
private static final List<String> _QUALIFIERS = Arrays.asList( QUALIFIERS );
|
||||
|
||||
private final static Properties ALIASES = new Properties();
|
||||
static {
|
||||
private static final Properties ALIASES = new Properties();
|
||||
static
|
||||
{
|
||||
ALIASES.put( "ga", "" );
|
||||
ALIASES.put( "final", "" );
|
||||
ALIASES.put( "cr", "rc" );
|
||||
}
|
||||
|
||||
/**
|
||||
* A comparable value for the empty-string qualifier. This one is used to determine if a given qualifier makes the
|
||||
* version older than one without a qualifier, or more recent.
|
||||
* A comparable value for the empty-string qualifier. This one is used to determine if a given qualifier makes
|
||||
* the version older than one without a qualifier, or more recent.
|
||||
*/
|
||||
private static String RELEASE_VERSION_INDEX = String.valueOf( _QUALIFIERS.indexOf( "" ) );
|
||||
private static final String RELEASE_VERSION_INDEX = String.valueOf( _QUALIFIERS.indexOf( "" ) );
|
||||
|
||||
private String value;
|
||||
|
||||
|
@ -285,7 +287,7 @@ public class ComparableVersion
|
|||
{
|
||||
return 0; // 1-0 = 1- (normalize) = 1
|
||||
}
|
||||
Item first = (Item) get(0);
|
||||
Item first = get( 0 );
|
||||
return first.compareTo( null );
|
||||
}
|
||||
switch ( item.getType() )
|
||||
|
@ -302,8 +304,8 @@ public class ComparableVersion
|
|||
|
||||
while ( left.hasNext() || right.hasNext() )
|
||||
{
|
||||
Item l = left.hasNext() ? (Item) left.next() : null;
|
||||
Item r = right.hasNext() ? (Item) right.next() : null;
|
||||
Item l = left.hasNext() ? left.next() : null;
|
||||
Item r = right.hasNext() ? right.next() : null;
|
||||
|
||||
// if this is shorter, then invert the compare and mul with -1
|
||||
int result = l == null ? -1 * r.compareTo( l ) : l.compareTo( r );
|
||||
|
@ -454,7 +456,7 @@ public class ComparableVersion
|
|||
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
return ( o instanceof ComparableVersion ) && canonical.equals( ( ( ComparableVersion )o ).canonical );
|
||||
return ( o instanceof ComparableVersion ) && canonical.equals( ( (ComparableVersion) o ).canonical );
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
|
|
|
@ -39,9 +39,7 @@ public class Restriction
|
|||
|
||||
public static final Restriction EVERYTHING = new Restriction( null, false, null, false );
|
||||
|
||||
public Restriction( ArtifactVersion lowerBound,
|
||||
boolean lowerBoundInclusive,
|
||||
ArtifactVersion upperBound,
|
||||
public Restriction( ArtifactVersion lowerBound, boolean lowerBoundInclusive, ArtifactVersion upperBound,
|
||||
boolean upperBoundInclusive )
|
||||
{
|
||||
this.lowerBound = lowerBound;
|
||||
|
@ -162,7 +160,7 @@ public class Restriction
|
|||
return true;
|
||||
}
|
||||
|
||||
if ( !(other instanceof Restriction ) )
|
||||
if ( !( other instanceof Restriction ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ package org.apache.maven.repository;
|
|||
|
||||
public class Proxy
|
||||
{
|
||||
public final static String PROXY_SOCKS5 = "SOCKS_5";
|
||||
public static final String PROXY_SOCKS5 = "SOCKS_5";
|
||||
|
||||
public final static String PROXY_SOCKS4 = "SOCKS4";
|
||||
public static final String PROXY_SOCKS4 = "SOCKS4";
|
||||
|
||||
public final static String PROXY_HTTP = "HTTP";
|
||||
public static final String PROXY_HTTP = "HTTP";
|
||||
|
||||
/**
|
||||
* Proxy server host
|
||||
|
@ -69,7 +69,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Return proxy server host name.
|
||||
*
|
||||
*
|
||||
* @return proxy server host name
|
||||
*/
|
||||
public String getHost()
|
||||
|
@ -79,7 +79,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Set proxy host name.
|
||||
*
|
||||
*
|
||||
* @param host proxy server host name
|
||||
*/
|
||||
public void setHost( String host )
|
||||
|
@ -89,7 +89,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Get user's password used to login to proxy server.
|
||||
*
|
||||
*
|
||||
* @return user's password at proxy host
|
||||
*/
|
||||
public String getPassword()
|
||||
|
@ -99,7 +99,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Set the user's password for the proxy server.
|
||||
*
|
||||
*
|
||||
* @param password password to use to login to a proxy server
|
||||
*/
|
||||
public void setPassword( String password )
|
||||
|
@ -109,7 +109,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Get the proxy port.
|
||||
*
|
||||
*
|
||||
* @return proxy server port
|
||||
*/
|
||||
public int getPort()
|
||||
|
@ -119,7 +119,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Set the proxy port.
|
||||
*
|
||||
*
|
||||
* @param port proxy server port
|
||||
*/
|
||||
public void setPort( int port )
|
||||
|
@ -129,7 +129,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Get the proxy username.
|
||||
*
|
||||
*
|
||||
* @return username for the proxy server
|
||||
*/
|
||||
public String getUserName()
|
||||
|
@ -139,7 +139,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Set the proxy username.
|
||||
*
|
||||
*
|
||||
* @param userName username for the proxy server
|
||||
*/
|
||||
public void setUserName( String userName )
|
||||
|
@ -149,7 +149,7 @@ public class Proxy
|
|||
|
||||
/**
|
||||
* Get the type of the proxy server.
|
||||
*
|
||||
*
|
||||
* @return the type of the proxy server
|
||||
*/
|
||||
public String getProtocol()
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.artifact;
|
|||
/**
|
||||
* Type safe reincarnation of Artifact scope. Also supplies the <code>DEFAULT_SCOPE<code> as well
|
||||
* as convenience method to deal with scope relationships.
|
||||
*
|
||||
*
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
|
@ -40,7 +40,7 @@ public enum ArtifactScopeEnum
|
|||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
int getId()
|
||||
{
|
||||
return id;
|
||||
|
@ -49,16 +49,16 @@ public enum ArtifactScopeEnum
|
|||
|
||||
/**
|
||||
* Helper method to simplify null processing
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static final ArtifactScopeEnum checkScope( ArtifactScopeEnum scope )
|
||||
{
|
||||
return scope == null ? DEFAULT_SCOPE : scope;
|
||||
return scope == null ? DEFAULT_SCOPE : scope;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return unsafe String representation of this scope.
|
||||
*/
|
||||
public String getScope()
|
||||
|
@ -90,40 +90,44 @@ public enum ArtifactScopeEnum
|
|||
return Artifact.SCOPE_RUNTIME_PLUS_SYSTEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final ArtifactScopeEnum [][][] _compliancySets = {
|
||||
{ { compile }, { compile, provided, system } }
|
||||
, { { test }, { compile, test, provided, system } }
|
||||
, { { runtime }, { compile, runtime, system } }
|
||||
, { { provided }, { compile, test, provided } }
|
||||
{ { compile }, { compile, provided, system } }
|
||||
, { { test }, { compile, test, provided, system } }
|
||||
, { { runtime }, { compile, runtime, system } }
|
||||
, { { provided }, { compile, test, provided } }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* scope relationship function. Used by the graph conflict resolution policies
|
||||
*
|
||||
*
|
||||
* @param scope
|
||||
* @return true is supplied scope is an inclusive sub-scope of current one.
|
||||
*/
|
||||
public boolean encloses( ArtifactScopeEnum scope )
|
||||
{
|
||||
final ArtifactScopeEnum s = checkScope(scope);
|
||||
|
||||
// system scope is historic only - and simple
|
||||
if( id == system.id )
|
||||
return scope.id == system.id;
|
||||
final ArtifactScopeEnum s = checkScope( scope );
|
||||
|
||||
for( ArtifactScopeEnum[][] set : _compliancySets )
|
||||
{
|
||||
if( id == set[0][0].id )
|
||||
{
|
||||
for( ArtifactScopeEnum ase : set[1] )
|
||||
{
|
||||
if( s.id == ase.id )
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
// system scope is historic only - and simple
|
||||
if ( id == system.id )
|
||||
{
|
||||
return scope.id == system.id;
|
||||
}
|
||||
|
||||
for ( ArtifactScopeEnum[][] set : _compliancySets )
|
||||
{
|
||||
if ( id == set[0][0].id )
|
||||
{
|
||||
for ( ArtifactScopeEnum ase : set[1] )
|
||||
{
|
||||
if ( s.id == ase.id )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.artifact;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||
|
||||
/**
|
||||
|
@ -35,16 +34,13 @@ public class UnknownRepositoryLayoutException
|
|||
|
||||
private final String layoutId;
|
||||
|
||||
public UnknownRepositoryLayoutException( String repositoryId,
|
||||
String layoutId )
|
||||
public UnknownRepositoryLayoutException( String repositoryId, String layoutId )
|
||||
{
|
||||
super( "Cannot find ArtifactRepositoryLayout instance for: " + layoutId, repositoryId );
|
||||
this.layoutId = layoutId;
|
||||
}
|
||||
|
||||
public UnknownRepositoryLayoutException( String repositoryId,
|
||||
String layoutId,
|
||||
ComponentLookupException e )
|
||||
public UnknownRepositoryLayoutException( String repositoryId, String layoutId, ComponentLookupException e )
|
||||
{
|
||||
super( "Cannot find ArtifactRepositoryLayout instance for: " + layoutId, repositoryId, e );
|
||||
this.layoutId = layoutId;
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.deployer;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -27,29 +31,31 @@ public interface ArtifactDeployer
|
|||
/**
|
||||
* Deploy an artifact from a particular directory. The artifact handler is used to determine the
|
||||
* filename of the source file.
|
||||
*
|
||||
*
|
||||
* @param basedir the directory where the artifact is stored
|
||||
* @param finalName the name of the artifact sans extension
|
||||
* @param finalName the name of the artifact without extension
|
||||
* @param artifact the artifact definition
|
||||
* @param deploymentRepository the repository to deploy to
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactDeploymentException if an error occurred deploying the artifact
|
||||
* @deprecated to be removed before 2.0 after the instlal/deploy plugins use the alternate
|
||||
* @deprecated to be removed before 2.0 after the install/deploy plugins use the alternate
|
||||
* method
|
||||
*/
|
||||
@Deprecated
|
||||
void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository, ArtifactRepository localRepository )
|
||||
void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException;
|
||||
|
||||
/**
|
||||
* Deploy an artifact from a particular file.
|
||||
*
|
||||
*
|
||||
* @param source the file to deploy
|
||||
* @param artifact the artifact definition
|
||||
* @param deploymentRepository the repository to deploy to
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactDeploymentException if an error occurred deploying the artifact
|
||||
*/
|
||||
void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository, ArtifactRepository localRepository )
|
||||
void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.deployer;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -40,7 +44,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.codehaus.plexus.util.FileUtils;
|
||||
|
||||
@Component (role=ArtifactDeployer.class)
|
||||
@Component( role = ArtifactDeployer.class )
|
||||
public class DefaultArtifactDeployer
|
||||
extends AbstractLogEnabled
|
||||
implements ArtifactDeployer
|
||||
|
@ -65,7 +69,8 @@ public class DefaultArtifactDeployer
|
|||
* correctly.
|
||||
*/
|
||||
@Deprecated
|
||||
public void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository, ArtifactRepository localRepository )
|
||||
public void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException
|
||||
{
|
||||
String extension = artifact.getArtifactHandler().getExtension();
|
||||
|
@ -73,7 +78,8 @@ public class DefaultArtifactDeployer
|
|||
deploy( source, artifact, deploymentRepository, localRepository );
|
||||
}
|
||||
|
||||
public void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository, ArtifactRepository localRepository )
|
||||
public void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException
|
||||
{
|
||||
deploymentRepository = injectSession( deploymentRepository );
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.installer;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -31,7 +35,7 @@ public interface ArtifactInstaller
|
|||
/**
|
||||
* Install an artifact from a particular directory. The artifact handler is used to determine
|
||||
* the filename of the source file.
|
||||
*
|
||||
*
|
||||
* @param basedir the directory where the artifact is stored
|
||||
* @param finalName the name of the artifact sans extension
|
||||
* @param artifact the artifact definition
|
||||
|
@ -46,7 +50,7 @@ public interface ArtifactInstaller
|
|||
|
||||
/**
|
||||
* Install an artifact from a particular file.
|
||||
*
|
||||
*
|
||||
* @param source the file to install
|
||||
* @param artifact the artifact definition
|
||||
* @param localRepository the local repository to install into
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.codehaus.plexus.util.FileUtils;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role=ArtifactInstaller.class)
|
||||
@Component( role = ArtifactInstaller.class )
|
||||
public class DefaultArtifactInstaller
|
||||
extends AbstractLogEnabled
|
||||
implements ArtifactInstaller
|
||||
|
|
|
@ -42,27 +42,27 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
|
||||
@Component(role=WagonManager.class)
|
||||
@Component( role = WagonManager.class )
|
||||
public class DefaultWagonManager
|
||||
extends org.apache.maven.repository.legacy.DefaultWagonManager
|
||||
implements WagonManager
|
||||
{
|
||||
|
||||
@Requirement
|
||||
private Logger logger;
|
||||
|
||||
private Logger logger;
|
||||
|
||||
@Requirement
|
||||
private LegacySupport legacySupport;
|
||||
|
||||
@Requirement
|
||||
private SettingsDecrypter settingsDecrypter;
|
||||
|
||||
|
||||
@Requirement
|
||||
private MirrorSelector mirrorSelector;
|
||||
|
||||
private MirrorSelector mirrorSelector;
|
||||
|
||||
@Requirement
|
||||
private ArtifactRepositoryFactory artifactRepositoryFactory;
|
||||
|
||||
|
||||
public AuthenticationInfo getAuthenticationInfo( String id )
|
||||
{
|
||||
MavenSession session = legacySupport.getSession();
|
||||
|
@ -153,13 +153,13 @@ public class DefaultWagonManager
|
|||
{
|
||||
getArtifact( artifact, remoteRepositories, null, false );
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public ArtifactRepository getMirrorRepository( ArtifactRepository repository )
|
||||
{
|
||||
|
||||
|
||||
Mirror mirror = mirrorSelector.getMirror( repository, legacySupport.getSession().getSettings().getMirrors() );
|
||||
|
||||
|
||||
if ( mirror != null )
|
||||
{
|
||||
String id = mirror.getId();
|
||||
|
@ -170,12 +170,12 @@ public class DefaultWagonManager
|
|||
}
|
||||
|
||||
logger.debug( "Using mirror: " + mirror.getUrl() + " (id: " + id + ")" );
|
||||
|
||||
|
||||
repository = artifactRepositoryFactory.createArtifactRepository( id, mirror.getUrl(),
|
||||
repository.getLayout(), repository.getSnapshots(),
|
||||
repository.getReleases() );
|
||||
}
|
||||
return repository;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
package org.apache.maven.artifact.manager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.wagon.ResourceDoesNotExistException;
|
||||
import org.apache.maven.wagon.TransferFailedException;
|
||||
import org.apache.maven.wagon.authentication.AuthenticationInfo;
|
||||
import org.apache.maven.wagon.proxy.ProxyInfo;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -28,6 +19,14 @@ import org.apache.maven.wagon.proxy.ProxyInfo;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.wagon.ResourceDoesNotExistException;
|
||||
import org.apache.maven.wagon.TransferFailedException;
|
||||
import org.apache.maven.wagon.authentication.AuthenticationInfo;
|
||||
import org.apache.maven.wagon.proxy.ProxyInfo;
|
||||
|
||||
/**
|
||||
* Manages <a href="http://maven.apache.org/wagon">Wagon</a> related operations in Maven.
|
||||
|
@ -40,7 +39,7 @@ public interface WagonManager
|
|||
extends org.apache.maven.repository.legacy.WagonManager
|
||||
{
|
||||
/**
|
||||
* this method is only here for backward compat (project-info-reports:dependencies)
|
||||
* this method is only here for backward compat (project-info-reports:dependencies)
|
||||
* the default implementation will return an empty AuthenticationInfo
|
||||
*/
|
||||
AuthenticationInfo getAuthenticationInfo( String id );
|
||||
|
@ -52,7 +51,7 @@ public interface WagonManager
|
|||
|
||||
void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
|
||||
ArtifactRepository getMirrorRepository( ArtifactRepository repository );
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.repository;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.UnknownRepositoryLayoutException;
|
||||
|
@ -35,12 +39,15 @@ public interface ArtifactRepositoryFactory
|
|||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId, boolean uniqueVersion )
|
||||
throws UnknownRepositoryLayoutException;
|
||||
|
||||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, boolean uniqueVersion );
|
||||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, ArtifactRepositoryLayout layout,
|
||||
boolean uniqueVersion );
|
||||
|
||||
ArtifactRepository createArtifactRepository( String id, String url, String layoutId, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
ArtifactRepository createArtifactRepository( String id, String url, String layoutId,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
throws UnknownRepositoryLayoutException;
|
||||
|
||||
ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
|
||||
ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
|
||||
|
||||
void setGlobalUpdatePolicy( String snapshotPolicy );
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class DefaultArtifactRepository
|
|||
private Authentication authentication;
|
||||
|
||||
private Proxy proxy;
|
||||
|
||||
|
||||
/**
|
||||
* Create a local repository or a test repository.
|
||||
*
|
||||
|
@ -88,7 +88,8 @@ public class DefaultArtifactRepository
|
|||
* @param snapshots the policies to use for snapshots
|
||||
* @param releases the policies to use for releases
|
||||
*/
|
||||
public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
public DefaultArtifactRepository( String id, String url, ArtifactRepositoryLayout layout,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
{
|
||||
super( id, url );
|
||||
|
||||
|
@ -121,8 +122,7 @@ public class DefaultArtifactRepository
|
|||
return layout.pathOfRemoteRepositoryMetadata( artifactMetadata );
|
||||
}
|
||||
|
||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata,
|
||||
ArtifactRepository repository )
|
||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
|
||||
{
|
||||
return layout.pathOfLocalRepositoryMetadata( metadata, repository );
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class DefaultArtifactRepository
|
|||
{
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
|
||||
public ArtifactRepositoryLayout getLayout()
|
||||
{
|
||||
return layout;
|
||||
|
@ -141,7 +141,7 @@ public class DefaultArtifactRepository
|
|||
{
|
||||
this.snapshots = snapshots;
|
||||
}
|
||||
|
||||
|
||||
public ArtifactRepositoryPolicy getSnapshots()
|
||||
{
|
||||
return snapshots;
|
||||
|
@ -171,7 +171,7 @@ public class DefaultArtifactRepository
|
|||
{
|
||||
this.blacklisted = blacklisted;
|
||||
}
|
||||
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -179,13 +179,13 @@ public class DefaultArtifactRepository
|
|||
sb.append( " id: " ).append( getId() ).append( "\n" );
|
||||
sb.append( " url: " ).append( getUrl() ).append( "\n" );
|
||||
sb.append( " layout: " ).append( layout != null ? layout.getId() : "none" ).append( "\n" );
|
||||
|
||||
|
||||
if ( snapshots != null )
|
||||
{
|
||||
sb.append( "snapshots: [enabled => " ).append( snapshots.isEnabled() );
|
||||
sb.append( ", update => " ).append( snapshots.getUpdatePolicy() ).append( "]\n" );
|
||||
}
|
||||
|
||||
|
||||
if ( releases != null )
|
||||
{
|
||||
sb.append( " releases: [enabled => " ).append( releases.isEnabled() );
|
||||
|
@ -198,16 +198,16 @@ public class DefaultArtifactRepository
|
|||
public Artifact find( Artifact artifact )
|
||||
{
|
||||
File artifactFile = new File( getBasedir(), pathOf( artifact ) );
|
||||
|
||||
|
||||
// We need to set the file here or the resolver will fail with an NPE, not fully equipped to deal
|
||||
// with multiple local repository implementations yet.
|
||||
artifact.setFile( artifactFile );
|
||||
|
||||
if( artifactFile.exists() )
|
||||
{
|
||||
artifact.setResolved( true );
|
||||
|
||||
if ( artifactFile.exists() )
|
||||
{
|
||||
artifact.setResolved( true );
|
||||
}
|
||||
|
||||
|
||||
return artifact;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,11 +34,11 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
/**
|
||||
* @author jdcasey
|
||||
*/
|
||||
@Component(role=ArtifactRepositoryFactory.class)
|
||||
@Component( role = ArtifactRepositoryFactory.class )
|
||||
public class DefaultArtifactRepositoryFactory
|
||||
implements ArtifactRepositoryFactory
|
||||
{
|
||||
|
||||
|
||||
@Requirement
|
||||
private org.apache.maven.repository.legacy.repository.ArtifactRepositoryFactory factory;
|
||||
|
||||
|
@ -54,26 +54,22 @@ public class DefaultArtifactRepositoryFactory
|
|||
return factory.getLayout( layoutId );
|
||||
}
|
||||
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id,
|
||||
String url,
|
||||
String layoutId,
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId,
|
||||
boolean uniqueVersion )
|
||||
throws UnknownRepositoryLayoutException
|
||||
{
|
||||
return injectSession( factory.createDeploymentArtifactRepository( id, url, layoutId, uniqueVersion ), false );
|
||||
}
|
||||
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id,
|
||||
String url,
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id, String url,
|
||||
ArtifactRepositoryLayout repositoryLayout,
|
||||
boolean uniqueVersion )
|
||||
{
|
||||
return injectSession( factory.createDeploymentArtifactRepository( id, url, repositoryLayout, uniqueVersion ), false);
|
||||
return injectSession( factory.createDeploymentArtifactRepository( id, url, repositoryLayout, uniqueVersion ),
|
||||
false );
|
||||
}
|
||||
|
||||
public ArtifactRepository createArtifactRepository( String id,
|
||||
String url,
|
||||
String layoutId,
|
||||
public ArtifactRepository createArtifactRepository( String id, String url, String layoutId,
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases )
|
||||
throws UnknownRepositoryLayoutException
|
||||
|
@ -81,8 +77,7 @@ public class DefaultArtifactRepositoryFactory
|
|||
return injectSession( factory.createArtifactRepository( layoutId, url, layoutId, snapshots, releases ), true );
|
||||
}
|
||||
|
||||
public ArtifactRepository createArtifactRepository( String id,
|
||||
String url,
|
||||
public ArtifactRepository createArtifactRepository( String id, String url,
|
||||
ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases )
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role=ArtifactRepositoryLayout.class, hint="flat")
|
||||
@Component( role = ArtifactRepositoryLayout.class, hint = "flat" )
|
||||
public class FlatRepositoryLayout
|
||||
implements ArtifactRepositoryLayout
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ public class FlatRepositoryLayout
|
|||
{
|
||||
return "flat";
|
||||
}
|
||||
|
||||
|
||||
public String pathOf( Artifact artifact )
|
||||
{
|
||||
ArtifactHandler artifactHandler = artifact.getArtifactHandler();
|
||||
|
@ -65,8 +65,7 @@ public class FlatRepositoryLayout
|
|||
return path.toString();
|
||||
}
|
||||
|
||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata,
|
||||
ArtifactRepository repository )
|
||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
|
||||
{
|
||||
return pathOfRepositoryMetadata( metadata.getLocalFilename( repository ) );
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ package org.apache.maven.artifact.repository.metadata;
|
|||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
|
@ -49,7 +49,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role=RepositoryMetadataManager.class)
|
||||
@Component( role = RepositoryMetadataManager.class )
|
||||
public class DefaultRepositoryMetadataManager
|
||||
extends AbstractLogEnabled
|
||||
implements RepositoryMetadataManager
|
||||
|
@ -60,7 +60,8 @@ public class DefaultRepositoryMetadataManager
|
|||
@Requirement
|
||||
private UpdateCheckManager updateCheckManager;
|
||||
|
||||
public void resolve( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
public void resolve( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws RepositoryMetadataResolutionException
|
||||
{
|
||||
RepositoryRequest request = new DefaultRepositoryRequest();
|
||||
|
@ -204,7 +205,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
catch ( RepositoryMetadataStoreException e )
|
||||
{
|
||||
throw new RepositoryMetadataResolutionException( "Unable to store local copy of metadata: " + e.getMessage(), e );
|
||||
throw new RepositoryMetadataResolutionException( "Unable to store local copy of metadata: "
|
||||
+ e.getMessage(), e );
|
||||
}
|
||||
|
||||
if ( cache != null )
|
||||
|
@ -342,7 +344,8 @@ public class DefaultRepositoryMetadataManager
|
|||
|
||||
}
|
||||
|
||||
private void mergeMetadata( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
private void mergeMetadata( RepositoryMetadata metadata, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws RepositoryMetadataStoreException
|
||||
{
|
||||
// TODO: currently this is first wins, but really we should take the latest by comparing either the
|
||||
|
@ -371,7 +374,9 @@ public class DefaultRepositoryMetadataManager
|
|||
updateSnapshotMetadata( metadata, previousMetadata, selected, localRepository );
|
||||
}
|
||||
|
||||
private void updateSnapshotMetadata( RepositoryMetadata metadata, Map<ArtifactRepository, Metadata> previousMetadata, ArtifactRepository selected, ArtifactRepository localRepository )
|
||||
private void updateSnapshotMetadata( RepositoryMetadata metadata,
|
||||
Map<ArtifactRepository, Metadata> previousMetadata,
|
||||
ArtifactRepository selected, ArtifactRepository localRepository )
|
||||
throws RepositoryMetadataStoreException
|
||||
{
|
||||
// TODO: this could be a lot nicer... should really be in the snapshot transformation?
|
||||
|
@ -396,7 +401,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( ( m.getVersioning() != null ) && ( m.getVersioning().getSnapshot() != null ) && m.getVersioning().getSnapshot().isLocalCopy() )
|
||||
if ( ( m.getVersioning() != null ) && ( m.getVersioning().getSnapshot() != null )
|
||||
&& m.getVersioning().getSnapshot().isLocalCopy() )
|
||||
{
|
||||
m.getVersioning().getSnapshot().setLocalCopy( false );
|
||||
metadata.setMetadata( m );
|
||||
|
@ -409,11 +415,14 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
}
|
||||
|
||||
private boolean loadMetadata( RepositoryMetadata repoMetadata, ArtifactRepository remoteRepository, ArtifactRepository localRepository, Map<ArtifactRepository, Metadata> previousMetadata )
|
||||
private boolean loadMetadata( RepositoryMetadata repoMetadata, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository, Map<ArtifactRepository, Metadata> previousMetadata )
|
||||
{
|
||||
boolean setRepository = false;
|
||||
|
||||
File metadataFile = new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( repoMetadata, remoteRepository ) );
|
||||
File metadataFile =
|
||||
new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( repoMetadata,
|
||||
remoteRepository ) );
|
||||
|
||||
if ( metadataFile.exists() )
|
||||
{
|
||||
|
@ -475,11 +484,13 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': " + e.getMessage(), e );
|
||||
throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': "
|
||||
+ e.getMessage(), e );
|
||||
}
|
||||
catch ( XmlPullParserException e )
|
||||
{
|
||||
throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': " + e.getMessage(), e );
|
||||
throw new RepositoryMetadataReadException( "Cannot read metadata from '" + mappingFile + "': "
|
||||
+ e.getMessage(), e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -490,8 +501,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
|
||||
/**
|
||||
* Ensures the last updated timestamp of the specified metadata does not refer to the future and fixes the local metadata if necessary to allow
|
||||
* proper merging/updating of metadata during deployment.
|
||||
* Ensures the last updated timestamp of the specified metadata does not refer to the future and fixes the local
|
||||
* metadata if necessary to allow proper merging/updating of metadata during deployment.
|
||||
*/
|
||||
private void fixTimestamp( File metadataFile, Metadata metadata, Metadata reference )
|
||||
{
|
||||
|
@ -547,7 +558,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
}
|
||||
|
||||
public void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository, ArtifactRepository remoteRepository )
|
||||
public void resolveAlways( RepositoryMetadata metadata, ArtifactRepository localRepository,
|
||||
ArtifactRepository remoteRepository )
|
||||
throws RepositoryMetadataResolutionException
|
||||
{
|
||||
File file;
|
||||
|
@ -557,7 +569,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
catch ( TransferFailedException e )
|
||||
{
|
||||
throw new RepositoryMetadataResolutionException( metadata + " could not be retrieved from repository: " + remoteRepository.getId() + " due to an error: " + e.getMessage(), e );
|
||||
throw new RepositoryMetadataResolutionException( metadata + " could not be retrieved from repository: "
|
||||
+ remoteRepository.getId() + " due to an error: " + e.getMessage(), e );
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -574,18 +587,24 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
}
|
||||
|
||||
private File getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository localRepository, ArtifactRepository remoteRepository )
|
||||
private File getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata,
|
||||
ArtifactRepository localRepository,
|
||||
ArtifactRepository remoteRepository )
|
||||
throws TransferFailedException
|
||||
{
|
||||
File file = new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( metadata, remoteRepository ) );
|
||||
File file =
|
||||
new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( metadata,
|
||||
remoteRepository ) );
|
||||
|
||||
try
|
||||
{
|
||||
wagonManager.getArtifactMetadataFromDeploymentRepository( metadata, remoteRepository, file, ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );
|
||||
wagonManager.getArtifactMetadataFromDeploymentRepository( metadata, remoteRepository, file,
|
||||
ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );
|
||||
}
|
||||
catch ( ResourceDoesNotExistException e )
|
||||
{
|
||||
getLogger().info( metadata + " could not be found on repository: " + remoteRepository.getId() + ", so will be created" );
|
||||
getLogger().info( metadata + " could not be found on repository: " + remoteRepository.getId()
|
||||
+ ", so will be created" );
|
||||
|
||||
// delete the local copy so the old details aren't used.
|
||||
if ( file.exists() )
|
||||
|
@ -603,7 +622,8 @@ public class DefaultRepositoryMetadataManager
|
|||
return file;
|
||||
}
|
||||
|
||||
public void deploy( ArtifactMetadata metadata, ArtifactRepository localRepository, ArtifactRepository deploymentRepository )
|
||||
public void deploy( ArtifactMetadata metadata, ArtifactRepository localRepository,
|
||||
ArtifactRepository deploymentRepository )
|
||||
throws RepositoryMetadataDeploymentException
|
||||
{
|
||||
File file;
|
||||
|
@ -616,7 +636,8 @@ public class DefaultRepositoryMetadataManager
|
|||
}
|
||||
catch ( TransferFailedException e )
|
||||
{
|
||||
throw new RepositoryMetadataDeploymentException( metadata + " could not be retrieved from repository: " + deploymentRepository.getId() + " due to an error: " + e.getMessage(), e );
|
||||
throw new RepositoryMetadataDeploymentException( metadata + " could not be retrieved from repository: "
|
||||
+ deploymentRepository.getId() + " due to an error: " + e.getMessage(), e );
|
||||
}
|
||||
|
||||
if ( file.isFile() )
|
||||
|
@ -634,7 +655,9 @@ public class DefaultRepositoryMetadataManager
|
|||
else
|
||||
{
|
||||
// It's a POM - we don't need to retrieve it first
|
||||
file = new File( localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
|
||||
file =
|
||||
new File( localRepository.getBasedir(),
|
||||
localRepository.pathOfLocalRepositoryMetadata( metadata, deploymentRepository ) );
|
||||
}
|
||||
|
||||
try
|
||||
|
|
|
@ -40,51 +40,53 @@ public interface ArtifactResolver
|
|||
|
||||
// The rest is deprecated
|
||||
|
||||
// USED BY MAVEN ASSEMBLY PLUGIN 2.2-beta-2
|
||||
// USED BY MAVEN ASSEMBLY PLUGIN 2.2-beta-2
|
||||
@Deprecated
|
||||
String ROLE = ArtifactResolver.class.getName();
|
||||
|
||||
// USED BY SUREFIRE
|
||||
@Deprecated
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
// USED BY MAVEN ASSEMBLY PLUGIN
|
||||
@Deprecated
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source )
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
// USED BY MAVEN ASSEMBLY PLUGIN
|
||||
@Deprecated
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
@Deprecated
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source )
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository, ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
@Deprecated
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners )
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
@Deprecated
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source,
|
||||
List<ResolutionListener> listeners )
|
||||
ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository, ArtifactMetadataSource source,
|
||||
List<ResolutionListener> listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
// USED BY REMOTE RESOURCES PLUGIN
|
||||
|
@ -94,11 +96,13 @@ public interface ArtifactResolver
|
|||
|
||||
// USED BY REMOTE RESOURCES PLUGIN
|
||||
@Deprecated
|
||||
void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, TransferListener downloadMonitor )
|
||||
void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository,
|
||||
TransferListener downloadMonitor )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
// USED BY ARCHETYPE DOWNLOADER
|
||||
@Deprecated
|
||||
void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
}
|
||||
|
|
|
@ -65,8 +65,7 @@ public class DebugResolutionListener
|
|||
logger.debug( indent + artifact + " (selected for " + artifact.getScope() + ")" );
|
||||
}
|
||||
|
||||
public void omitForNearer( Artifact omitted,
|
||||
Artifact kept )
|
||||
public void omitForNearer( Artifact omitted, Artifact kept )
|
||||
{
|
||||
String omittedVersion = omitted.getVersion();
|
||||
String keptVersion = kept.getVersion();
|
||||
|
@ -82,12 +81,10 @@ public class DebugResolutionListener
|
|||
logger.debug( indent + omitted + " (removed - causes a cycle in the graph)" );
|
||||
}
|
||||
|
||||
public void updateScopeCurrentPom( Artifact artifact,
|
||||
String ignoredScope )
|
||||
public void updateScopeCurrentPom( Artifact artifact, String ignoredScope )
|
||||
{
|
||||
logger.debug(
|
||||
indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope " + artifact.getScope()
|
||||
+ " wins)" );
|
||||
logger.debug( indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope "
|
||||
+ artifact.getScope() + " wins)" );
|
||||
|
||||
// TODO: better way than static? this might hide messages in a reactor
|
||||
if ( !ignoredArtifacts.contains( artifact ) )
|
||||
|
@ -99,8 +96,7 @@ public class DebugResolutionListener
|
|||
}
|
||||
}
|
||||
|
||||
public void updateScope( Artifact artifact,
|
||||
String scope )
|
||||
public void updateScope( Artifact artifact, String scope )
|
||||
{
|
||||
logger.debug( indent + artifact + " (setting artifactScope to: " + scope + ")" );
|
||||
}
|
||||
|
@ -111,9 +107,7 @@ public class DebugResolutionListener
|
|||
+ artifact.getVersionRange() + ")" );
|
||||
}
|
||||
|
||||
public void restrictRange( Artifact artifact,
|
||||
Artifact replacement,
|
||||
VersionRange newRange )
|
||||
public void restrictRange( Artifact artifact, Artifact replacement, VersionRange newRange )
|
||||
{
|
||||
logger.debug( indent + artifact + " (range restricted from: " + artifact.getVersionRange() + " and: "
|
||||
+ replacement.getVersionRange() + " to: " + newRange + " )" );
|
||||
|
@ -125,8 +119,7 @@ public class DebugResolutionListener
|
|||
* more information) is needed to be able to determine when and if the version and/or artifactScope changes. See the two
|
||||
* added methods, manageArtifactVersion and manageArtifactScope.
|
||||
*/
|
||||
public void manageArtifact( Artifact artifact,
|
||||
Artifact replacement )
|
||||
public void manageArtifact( Artifact artifact, Artifact replacement )
|
||||
{
|
||||
String msg = indent + artifact;
|
||||
msg += " (";
|
||||
|
@ -142,8 +135,7 @@ public class DebugResolutionListener
|
|||
logger.debug( msg );
|
||||
}
|
||||
|
||||
public void manageArtifactVersion( Artifact artifact,
|
||||
Artifact replacement )
|
||||
public void manageArtifactVersion( Artifact artifact, Artifact replacement )
|
||||
{
|
||||
// only show msg if a change is actually taking place
|
||||
if ( !replacement.getVersion().equals( artifact.getVersion() ) )
|
||||
|
@ -153,8 +145,7 @@ public class DebugResolutionListener
|
|||
}
|
||||
}
|
||||
|
||||
public void manageArtifactScope( Artifact artifact,
|
||||
Artifact replacement )
|
||||
public void manageArtifactScope( Artifact artifact, Artifact replacement )
|
||||
{
|
||||
// only show msg if a change is actually taking place
|
||||
if ( !replacement.getScope().equals( artifact.getScope() ) )
|
||||
|
@ -164,8 +155,7 @@ public class DebugResolutionListener
|
|||
}
|
||||
}
|
||||
|
||||
public void manageArtifactSystemPath( Artifact artifact,
|
||||
Artifact replacement )
|
||||
public void manageArtifactSystemPath( Artifact artifact, Artifact replacement )
|
||||
{
|
||||
// only show msg if a change is actually taking place
|
||||
if ( !replacement.getScope().equals( artifact.getScope() ) )
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.artifact.resolver;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
@Deprecated
|
||||
@Component(role=ArtifactCollector.class)
|
||||
@Component( role = ArtifactCollector.class )
|
||||
public class DefaultArtifactCollector
|
||||
extends org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector
|
||||
implements ArtifactCollector
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.artifact.resolver;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -69,13 +73,13 @@ import org.codehaus.plexus.util.FileUtils;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role = ArtifactResolver.class)
|
||||
@Component( role = ArtifactResolver.class )
|
||||
public class DefaultArtifactResolver
|
||||
implements ArtifactResolver
|
||||
{
|
||||
@Requirement
|
||||
@Requirement
|
||||
private Logger logger;
|
||||
|
||||
|
||||
@Requirement
|
||||
private WagonManager wagonManager;
|
||||
|
||||
|
@ -93,7 +97,7 @@ public class DefaultArtifactResolver
|
|||
|
||||
@Requirement
|
||||
private ArtifactMetadataSource source;
|
||||
|
||||
|
||||
@Requirement
|
||||
private PlexusContainer container;
|
||||
|
||||
|
@ -157,7 +161,8 @@ public class DefaultArtifactResolver
|
|||
}
|
||||
}
|
||||
|
||||
public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, TransferListener resolutionListener )
|
||||
public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository, TransferListener resolutionListener )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
RepositoryRequest request = new DefaultRepositoryRequest();
|
||||
|
@ -167,7 +172,8 @@ public class DefaultArtifactResolver
|
|||
resolve( artifact, request, resolutionListener, false );
|
||||
}
|
||||
|
||||
public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
public void resolveAlways( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
RepositoryRequest request = new DefaultRepositoryRequest();
|
||||
|
@ -177,7 +183,8 @@ public class DefaultArtifactResolver
|
|||
resolve( artifact, request, null, true );
|
||||
}
|
||||
|
||||
private void resolve( Artifact artifact, RepositoryRequest request, TransferListener downloadMonitor, boolean force )
|
||||
private void resolve( Artifact artifact, RepositoryRequest request, TransferListener downloadMonitor,
|
||||
boolean force )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
if ( artifact == null )
|
||||
|
@ -186,28 +193,31 @@ public class DefaultArtifactResolver
|
|||
}
|
||||
|
||||
File destination;
|
||||
|
||||
|
||||
if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
|
||||
{
|
||||
File systemFile = artifact.getFile();
|
||||
|
||||
if ( systemFile == null )
|
||||
{
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " has no file attached", artifact );
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " has no file attached",
|
||||
artifact );
|
||||
}
|
||||
|
||||
if ( !systemFile.exists() )
|
||||
{
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " not found in path: " + systemFile, artifact );
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " not found in path: "
|
||||
+ systemFile, artifact );
|
||||
}
|
||||
|
||||
if ( !systemFile.isFile() )
|
||||
{
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " is not a file: " + systemFile, artifact );
|
||||
throw new ArtifactNotFoundException( "System artifact: " + artifact + " is not a file: " + systemFile,
|
||||
artifact );
|
||||
}
|
||||
|
||||
artifact.setResolved( true );
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -224,7 +234,7 @@ public class DefaultArtifactResolver
|
|||
// ----------------------------------------------------------------------
|
||||
|
||||
artifact = localRepository.find( artifact );
|
||||
|
||||
|
||||
if ( artifact.isResolved() )
|
||||
{
|
||||
return;
|
||||
|
@ -241,11 +251,13 @@ public class DefaultArtifactResolver
|
|||
if ( artifact.getRepository() != null )
|
||||
{
|
||||
// the transformations discovered the artifact - so use it exclusively
|
||||
wagonManager.getArtifact( artifact, artifact.getRepository(), downloadMonitor, request.isForceUpdate() );
|
||||
wagonManager.getArtifact( artifact, artifact.getRepository(), downloadMonitor,
|
||||
request.isForceUpdate() );
|
||||
}
|
||||
else
|
||||
{
|
||||
wagonManager.getArtifact( artifact, remoteRepositories, downloadMonitor, request.isForceUpdate() );
|
||||
wagonManager.getArtifact( artifact, remoteRepositories, downloadMonitor,
|
||||
request.isForceUpdate() );
|
||||
}
|
||||
|
||||
if ( localRepositoryMaintainer != null )
|
||||
|
@ -285,7 +297,7 @@ public class DefaultArtifactResolver
|
|||
remoteRepositories );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 1.0-SNAPSHOT
|
||||
//
|
||||
// 1) pom = 1.0-SNAPSHOT
|
||||
|
@ -300,7 +312,7 @@ public class DefaultArtifactResolver
|
|||
|
||||
// Make a file with a 1.0-SNAPSHOT format
|
||||
File copy = new File( localRepository.getBasedir(), localRepository.pathOf( artifact ) );
|
||||
|
||||
|
||||
// if the timestamped version was resolved or the copy doesn't exist then copy a version
|
||||
// of the file like 1.0-SNAPSHOT. Even if there is a timestamped version the non-timestamped
|
||||
// version will be created.
|
||||
|
@ -316,7 +328,8 @@ public class DefaultArtifactResolver
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new ArtifactResolutionException( "Unable to copy resolved artifact for local use: " + e.getMessage(), artifact, remoteRepositories, e );
|
||||
throw new ArtifactResolutionException( "Unable to copy resolved artifact for local use: "
|
||||
+ e.getMessage(), artifact, remoteRepositories, e );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,52 +385,73 @@ public class DefaultArtifactResolver
|
|||
return localCopy;
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository, remoteRepositories, source, filter );
|
||||
return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository,
|
||||
remoteRepositories, source, filter );
|
||||
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source )
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, null );
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
|
||||
remoteRepositories, source, null );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, filter, null );
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
|
||||
remoteRepositories, source, filter, null );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository,
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, localRepository, remoteRepositories, source, null );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source, List<ResolutionListener> listeners )
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source,
|
||||
List<ResolutionListener> listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, Collections.EMPTY_MAP, localRepository,
|
||||
remoteRepositories, source, null, listeners );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter, List<ResolutionListener> listeners )
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository, remoteRepositories, source, filter, listeners, null );
|
||||
return resolveTransitively( artifacts, originatingArtifact, managedVersions, localRepository,
|
||||
remoteRepositories, source, filter, listeners, null );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories, ArtifactMetadataSource source, ArtifactFilter filter, List<ResolutionListener> listeners,
|
||||
public ArtifactResolutionResult resolveTransitively( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
|
@ -425,7 +459,7 @@ public class DefaultArtifactResolver
|
|||
.setArtifact( originatingArtifact )
|
||||
.setResolveRoot( false )
|
||||
// This is required by the surefire plugin
|
||||
.setArtifactDependencies( artifacts )
|
||||
.setArtifactDependencies( artifacts )
|
||||
.setManagedVersionMap( managedVersions )
|
||||
.setLocalRepository( localRepository )
|
||||
.setRemoteRepositories( remoteRepositories )
|
||||
|
@ -461,10 +495,10 @@ public class DefaultArtifactResolver
|
|||
Set<Artifact> artifacts = request.getArtifactDependencies();
|
||||
Map managedVersions = request.getManagedVersionMap();
|
||||
List<ResolutionListener> listeners = request.getListeners();
|
||||
ArtifactFilter collectionFilter = request.getCollectionFilter();
|
||||
ArtifactFilter collectionFilter = request.getCollectionFilter();
|
||||
ArtifactFilter resolutionFilter = request.getResolutionFilter();
|
||||
TransferListener transferListener = TransferListenerAdapter.newAdapter( request.getTransferListener() );
|
||||
|
||||
|
||||
//TODO: hack because metadata isn't generated in m2e correctly and i want to run the maven i have in the workspace
|
||||
if ( source == null )
|
||||
{
|
||||
|
@ -496,9 +530,9 @@ public class DefaultArtifactResolver
|
|||
// This is often an artifact like a POM that is taken from disk and we already have hold of the
|
||||
// file reference. But this may be a Maven Plugin that we need to resolve from a remote repository
|
||||
// as well as its dependencies.
|
||||
|
||||
|
||||
if ( request.isResolveRoot() /* && rootArtifact.getFile() == null */ )
|
||||
{
|
||||
{
|
||||
try
|
||||
{
|
||||
resolve( rootArtifact, request, transferListener, false );
|
||||
|
@ -573,7 +607,7 @@ public class DefaultArtifactResolver
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( artifacts == null || artifacts.isEmpty() )
|
||||
{
|
||||
if ( request.isResolveRoot() )
|
||||
|
@ -581,18 +615,19 @@ public class DefaultArtifactResolver
|
|||
result.addArtifact( rootArtifact );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// After the collection we will have the artifact object in the result but they will not be resolved yet.
|
||||
result =
|
||||
artifactCollector.collect( artifacts, rootArtifact, managedVersions, collectionRequest, source,
|
||||
collectionFilter, listeners, null );
|
||||
|
||||
|
||||
// We have metadata retrieval problems, or there are cycles that have been detected
|
||||
// so we give this back to the calling code and let them deal with this information
|
||||
// appropriately.
|
||||
|
||||
if ( result.hasMetadataResolutionExceptions() || result.hasVersionRangeViolations() || result.hasCircularDependencyExceptions() )
|
||||
if ( result.hasMetadataResolutionExceptions() || result.hasVersionRangeViolations()
|
||||
|| result.hasCircularDependencyExceptions() )
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
@ -634,18 +669,19 @@ public class DefaultArtifactResolver
|
|||
// We want to send the root artifact back in the result but we need to do this after the other dependencies
|
||||
// have been resolved.
|
||||
if ( request.isResolveRoot() )
|
||||
{
|
||||
{
|
||||
// Add the root artifact (as the first artifact to retain logical order of class path!)
|
||||
Set<Artifact> allArtifacts = new LinkedHashSet<Artifact>();
|
||||
allArtifacts.add( rootArtifact );
|
||||
allArtifacts.addAll( result.getArtifacts() );
|
||||
result.setArtifacts( allArtifacts );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
public void resolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
resolve( artifact, remoteRepositories, localRepository, null );
|
||||
|
@ -667,8 +703,9 @@ public class DefaultArtifactResolver
|
|||
|
||||
private final ArtifactResolutionResult result;
|
||||
|
||||
public ResolveTask( ClassLoader classLoader, CountDownLatch latch, Artifact artifact, TransferListener transferListener,
|
||||
ArtifactResolutionRequest request, ArtifactResolutionResult result )
|
||||
public ResolveTask( ClassLoader classLoader, CountDownLatch latch, Artifact artifact,
|
||||
TransferListener transferListener, ArtifactResolutionRequest request,
|
||||
ArtifactResolutionResult result )
|
||||
{
|
||||
this.classLoader = classLoader;
|
||||
this.latch = latch;
|
||||
|
|
|
@ -37,12 +37,12 @@ import java.util.Properties;
|
|||
* @version $Id$
|
||||
*/
|
||||
@Deprecated
|
||||
@Component(role=RuntimeInformation.class)
|
||||
@Component( role = RuntimeInformation.class )
|
||||
public class DefaultRuntimeInformation
|
||||
implements RuntimeInformation, Initializable
|
||||
{
|
||||
private static final String MAVEN_GROUPID = "org.apache.maven";
|
||||
|
||||
|
||||
private static final String MAVEN_PROPERTIES = "META-INF/maven/" + MAVEN_GROUPID + "/maven-core/pom.properties";
|
||||
|
||||
private ArtifactVersion applicationVersion;
|
||||
|
@ -60,7 +60,7 @@ public class DefaultRuntimeInformation
|
|||
{
|
||||
Properties properties = new Properties();
|
||||
resourceAsStream = getClass().getClassLoader().getResourceAsStream( MAVEN_PROPERTIES );
|
||||
|
||||
|
||||
if ( resourceAsStream == null )
|
||||
{
|
||||
throw new IllegalStateException( "Unable to find Maven properties in classpath: " + MAVEN_PROPERTIES );
|
||||
|
|
|
@ -72,7 +72,8 @@ public class DefaultMavenProfilesBuilder
|
|||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment substitution in " + PROFILES_XML_FILE + "." );
|
||||
getLogger().warn( "Failed to initialize environment variable resolver. Skipping environment "
|
||||
+ "substitution in " + PROFILES_XML_FILE + "." );
|
||||
getLogger().debug( "Failed to initialize envar resolver. Skipping resolution.", e );
|
||||
}
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ public class DefaultProfileManager
|
|||
private Properties requestProperties;
|
||||
|
||||
/**
|
||||
* @deprecated without passing in the system properties, the SystemPropertiesProfileActivator will not work correctly
|
||||
* in embedded envirnments.
|
||||
* @deprecated without passing in the system properties, the SystemPropertiesProfileActivator will not work
|
||||
* correctly in embedded envirnments.
|
||||
*/
|
||||
public DefaultProfileManager( PlexusContainer container )
|
||||
{
|
||||
|
|
|
@ -88,11 +88,13 @@ public class FileProfileActivator
|
|||
{
|
||||
if ( logger.isDebugEnabled() )
|
||||
{
|
||||
logger.debug( "Failed to interpolate missing file location for profile activator: " + fileString, e );
|
||||
logger.debug( "Failed to interpolate missing file location for profile activator: " + fileString,
|
||||
e );
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn( "Failed to interpolate missing file location for profile activator: " + fileString + ". Run in debug mode (-X) for more information." );
|
||||
logger.warn( "Failed to interpolate missing file location for profile activator: " + fileString
|
||||
+ ". Run in debug mode (-X) for more information." );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,14 +44,7 @@ public class JdkPrefixProfileActivator
|
|||
{
|
||||
try
|
||||
{
|
||||
if ( matchJdkVersionRange( jdk ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return matchJdkVersionRange( jdk );
|
||||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
|
|
|
@ -24,9 +24,9 @@ public class ProfileActivationException
|
|||
extends Exception
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -90820222109103638L;
|
||||
private static final long serialVersionUID = -90820222109103638L;
|
||||
|
||||
public ProfileActivationException( String message, Throwable cause )
|
||||
public ProfileActivationException( String message, Throwable cause )
|
||||
{
|
||||
super( message, cause );
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.apache.maven.model.Profile;
|
|||
@Deprecated
|
||||
public interface ProfileActivator
|
||||
{
|
||||
static final String ROLE = ProfileActivator.class.getName();
|
||||
final String ROLE = ProfileActivator.class.getName();
|
||||
|
||||
boolean canDetermineActivation( Profile profile );
|
||||
|
||||
|
|
|
@ -33,12 +33,13 @@ public class SystemPropertyProfileActivator
|
|||
extends DetectedProfileActivator implements Contextualizable
|
||||
{
|
||||
private Properties properties;
|
||||
|
||||
public void contextualize(Context context) throws ContextException
|
||||
|
||||
public void contextualize( Context context )
|
||||
throws ContextException
|
||||
{
|
||||
properties = (Properties)context.get("SystemProperties");
|
||||
properties = (Properties) context.get( "SystemProperties" );
|
||||
}
|
||||
|
||||
|
||||
protected boolean canDetectActivation( Profile profile )
|
||||
{
|
||||
return profile.getActivation() != null && profile.getActivation().getProperty() != null;
|
||||
|
@ -55,19 +56,19 @@ public class SystemPropertyProfileActivator
|
|||
{
|
||||
String name = property.getName();
|
||||
boolean reverseName = false;
|
||||
|
||||
|
||||
if ( name == null )
|
||||
{
|
||||
throw new ProfileActivationException( "The property name is required to activate the profile '"
|
||||
+ profile.getId() + "'" );
|
||||
}
|
||||
|
||||
|
||||
if ( name.startsWith("!") )
|
||||
{
|
||||
reverseName = true;
|
||||
name = name.substring( 1 );
|
||||
}
|
||||
|
||||
|
||||
String sysValue = properties.getProperty( name );
|
||||
|
||||
String propValue = property.getValue();
|
||||
|
@ -79,10 +80,10 @@ public class SystemPropertyProfileActivator
|
|||
reverseValue = true;
|
||||
propValue = propValue.substring( 1 );
|
||||
}
|
||||
|
||||
|
||||
// we have a value, so it has to match the system value...
|
||||
boolean result = propValue.equals( sysValue );
|
||||
|
||||
|
||||
if ( reverseValue )
|
||||
{
|
||||
return !result;
|
||||
|
@ -95,7 +96,7 @@ public class SystemPropertyProfileActivator
|
|||
else
|
||||
{
|
||||
boolean result = StringUtils.isNotEmpty( sysValue );
|
||||
|
||||
|
||||
if ( reverseName )
|
||||
{
|
||||
return !result;
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.project;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -41,7 +45,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
/**
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role = MavenProjectBuilder.class)
|
||||
@Component( role = MavenProjectBuilder.class )
|
||||
@Deprecated
|
||||
public class DefaultMavenProjectBuilder
|
||||
implements MavenProjectBuilder
|
||||
|
@ -176,7 +180,7 @@ public class DefaultMavenProjectBuilder
|
|||
|
||||
/**
|
||||
* This is used for pom-less execution like running archetype:generate.
|
||||
*
|
||||
*
|
||||
* I am taking out the profile handling and the interpolation of the base directory until we
|
||||
* spec this out properly.
|
||||
*/
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.project;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -37,11 +41,13 @@ public interface MavenProjectBuilder
|
|||
throws ProjectBuildingException;
|
||||
|
||||
//TODO remote-resources-plugin
|
||||
MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ProjectBuildingException;
|
||||
|
||||
//TODO remote-resources-plugin
|
||||
MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository, boolean allowStubModel )
|
||||
MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository, boolean allowStubModel )
|
||||
throws ProjectBuildingException;
|
||||
|
||||
// TODO: this is only to provide a project for plugins that don't need a project to execute but need some
|
||||
|
|
|
@ -40,17 +40,19 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
|
|||
@Deprecated
|
||||
public final class ProjectUtils
|
||||
{
|
||||
|
||||
|
||||
private ProjectUtils()
|
||||
{
|
||||
}
|
||||
|
||||
public static List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories, ArtifactRepositoryFactory artifactRepositoryFactory, PlexusContainer c )
|
||||
public static List<ArtifactRepository> buildArtifactRepositories( List<Repository> repositories,
|
||||
ArtifactRepositoryFactory artifactRepositoryFactory,
|
||||
PlexusContainer c )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
|
||||
List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
|
||||
|
||||
|
||||
for ( Repository r : repositories )
|
||||
{
|
||||
remoteRepositories.add( buildArtifactRepository( r, artifactRepositoryFactory, c ) );
|
||||
|
@ -59,13 +61,17 @@ public final class ProjectUtils
|
|||
return remoteRepositories;
|
||||
}
|
||||
|
||||
public static ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo, ArtifactRepositoryFactory artifactRepositoryFactory, PlexusContainer c )
|
||||
public static ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo,
|
||||
ArtifactRepositoryFactory artifactRepositoryFactory,
|
||||
PlexusContainer c )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
return buildArtifactRepository( repo, artifactRepositoryFactory, c );
|
||||
}
|
||||
|
||||
public static ArtifactRepository buildArtifactRepository( Repository repo, ArtifactRepositoryFactory artifactRepositoryFactory, PlexusContainer c )
|
||||
public static ArtifactRepository buildArtifactRepository( Repository repo,
|
||||
ArtifactRepositoryFactory artifactRepositoryFactory,
|
||||
PlexusContainer c )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
RepositorySystem repositorySystem = rs( c );
|
||||
|
|
|
@ -48,12 +48,12 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
|
||||
@Component(role = ModelInheritanceAssembler.class)
|
||||
@Component( role = ModelInheritanceAssembler.class )
|
||||
public class DefaultModelInheritanceAssembler
|
||||
implements ModelInheritanceAssembler
|
||||
{
|
||||
// TODO: Remove this!
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
|
||||
{
|
||||
// The build has been set but we want to step in here and fill in
|
||||
|
@ -84,7 +84,7 @@ public class DefaultModelInheritanceAssembler
|
|||
childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
|
||||
}
|
||||
|
||||
// Extensions are accumlated
|
||||
// Extensions are accumulated
|
||||
mergeExtensionLists( childBuild, parentBuild );
|
||||
|
||||
if ( childBuild.getDirectory() == null )
|
||||
|
@ -305,7 +305,7 @@ public class DefaultModelInheritanceAssembler
|
|||
}
|
||||
|
||||
// TODO: Remove this!
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings( "unchecked" )
|
||||
private void assembleDependencyManagementInheritance( Model child, Model parent )
|
||||
{
|
||||
DependencyManagement parentDepMgmt = parent.getDependencyManagement();
|
||||
|
@ -536,7 +536,7 @@ public class DefaultModelInheritanceAssembler
|
|||
}
|
||||
|
||||
// TODO: Remove this!
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings( "unchecked" )
|
||||
private void assembleDependencyInheritance( Model child, Model parent )
|
||||
{
|
||||
Map<String, Dependency> depsMap = new LinkedHashMap<String, Dependency>();
|
||||
|
|
|
@ -90,9 +90,9 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
}
|
||||
|
||||
private PathTranslator pathTranslator;
|
||||
|
||||
|
||||
private Interpolator interpolator;
|
||||
|
||||
|
||||
private RecursionInterceptor recursionInterceptor;
|
||||
|
||||
// for testing.
|
||||
|
@ -206,7 +206,7 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
{
|
||||
List<ValueSource> valueSources = createValueSources( model, projectDir, config );
|
||||
List<InterpolationPostProcessor> postProcessors = createPostProcessors( model, projectDir, config );
|
||||
|
||||
|
||||
return interpolateInternal( src, valueSources, postProcessors, debug );
|
||||
}
|
||||
finally
|
||||
|
@ -214,8 +214,9 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
interpolator.clearAnswers();
|
||||
}
|
||||
}
|
||||
|
||||
protected List<ValueSource> createValueSources( final Model model, final File projectDir, final ProjectBuilderConfiguration config )
|
||||
|
||||
protected List<ValueSource> createValueSources( final Model model, final File projectDir,
|
||||
final ProjectBuilderConfiguration config )
|
||||
{
|
||||
String timestampFormat = DEFAULT_BUILD_TIMESTAMP_FORMAT;
|
||||
|
||||
|
@ -228,7 +229,8 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
ValueSource modelValueSource1 = new PrefixedObjectValueSource( PROJECT_PREFIXES, model, false );
|
||||
ValueSource modelValueSource2 = new ObjectBasedValueSource( model );
|
||||
|
||||
ValueSource basedirValueSource = new PrefixedValueSourceWrapper( new AbstractValueSource( false ){
|
||||
ValueSource basedirValueSource = new PrefixedValueSourceWrapper( new AbstractValueSource( false )
|
||||
{
|
||||
public Object getValue( String expression )
|
||||
{
|
||||
if ( projectDir != null && "basedir".equals( expression ) )
|
||||
|
@ -237,9 +239,9 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
PROJECT_PREFIXES, true );
|
||||
ValueSource baseUriValueSource = new PrefixedValueSourceWrapper( new AbstractValueSource( false ){
|
||||
}, PROJECT_PREFIXES, true );
|
||||
ValueSource baseUriValueSource = new PrefixedValueSourceWrapper( new AbstractValueSource( false )
|
||||
{
|
||||
public Object getValue( String expression )
|
||||
{
|
||||
if ( projectDir != null && "baseUri".equals( expression ) )
|
||||
|
@ -248,11 +250,10 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
PROJECT_PREFIXES, false );
|
||||
|
||||
}, PROJECT_PREFIXES, false );
|
||||
|
||||
List<ValueSource> valueSources = new ArrayList<ValueSource>( 9 );
|
||||
|
||||
|
||||
// NOTE: Order counts here!
|
||||
valueSources.add( basedirValueSource );
|
||||
valueSources.add( baseUriValueSource );
|
||||
|
@ -269,10 +270,10 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
}
|
||||
} );
|
||||
valueSources.add( modelValueSource2 );
|
||||
|
||||
|
||||
return valueSources;
|
||||
}
|
||||
|
||||
|
||||
protected List<InterpolationPostProcessor> createPostProcessors( final Model model, final File projectDir,
|
||||
final ProjectBuilderConfiguration config )
|
||||
{
|
||||
|
@ -282,7 +283,7 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
projectDir,
|
||||
pathTranslator ) );
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected String interpolateInternal( String src, List<ValueSource> valueSources,
|
||||
List<InterpolationPostProcessor> postProcessors, boolean debug )
|
||||
|
@ -292,18 +293,18 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
{
|
||||
return src;
|
||||
}
|
||||
|
||||
|
||||
Logger logger = getLogger();
|
||||
|
||||
String result = src;
|
||||
synchronized( this )
|
||||
{
|
||||
|
||||
|
||||
for ( ValueSource vs : valueSources )
|
||||
{
|
||||
interpolator.addValueSource( vs );
|
||||
}
|
||||
|
||||
|
||||
for ( InterpolationPostProcessor postProcessor : postProcessors )
|
||||
{
|
||||
interpolator.addPostProcessor( postProcessor );
|
||||
|
@ -367,7 +368,7 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
{
|
||||
interpolator.removeValuesSource( vs );
|
||||
}
|
||||
|
||||
|
||||
for ( InterpolationPostProcessor postProcessor : postProcessors )
|
||||
{
|
||||
interpolator.removePostProcessor( postProcessor );
|
||||
|
@ -377,7 +378,7 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
protected RecursionInterceptor getRecursionInterceptor()
|
||||
{
|
||||
return recursionInterceptor;
|
||||
|
@ -396,7 +397,7 @@ public abstract class AbstractStringBasedModelInterpolator
|
|||
interpolator = createInterpolator();
|
||||
recursionInterceptor = new PrefixAwareRecursionInterceptor( PROJECT_PREFIXES );
|
||||
}
|
||||
|
||||
|
||||
protected final Interpolator getInterpolator()
|
||||
{
|
||||
return interpolator;
|
||||
|
|
|
@ -24,7 +24,7 @@ package org.apache.maven.project.interpolation;
|
|||
* <p/>
|
||||
* Created on Feb 2, 2005
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@SuppressWarnings( "serial" )
|
||||
@Deprecated
|
||||
public class ModelInterpolationException
|
||||
extends Exception
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.File;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -40,7 +40,8 @@ public class PathTranslatingPostProcessor
|
|||
private final PathTranslator pathTranslator;
|
||||
private final List<String> expressionPrefixes;
|
||||
|
||||
public PathTranslatingPostProcessor( List<String> expressionPrefixes, List<String> unprefixedPathKeys, File projectDir, PathTranslator pathTranslator )
|
||||
public PathTranslatingPostProcessor( List<String> expressionPrefixes, List<String> unprefixedPathKeys,
|
||||
File projectDir, PathTranslator pathTranslator )
|
||||
{
|
||||
this.expressionPrefixes = expressionPrefixes;
|
||||
this.unprefixedPathKeys = unprefixedPathKeys;
|
||||
|
@ -52,7 +53,7 @@ public class PathTranslatingPostProcessor
|
|||
Object value )
|
||||
{
|
||||
expression = ValueSourceUtils.trimPrefix( expression, expressionPrefixes, true );
|
||||
|
||||
|
||||
if ( projectDir != null && value != null && unprefixedPathKeys.contains( expression ) )
|
||||
{
|
||||
return pathTranslator.alignToBaseDirectory( String.valueOf( value ), projectDir );
|
||||
|
|
|
@ -63,10 +63,10 @@ public class StringSearchModelInterpolator
|
|||
throws ModelInterpolationException
|
||||
{
|
||||
interpolateObject( model, model, projectDir, config, debugEnabled );
|
||||
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
protected void interpolateObject( Object obj, Model model, File projectDir, ProjectBuilderConfiguration config,
|
||||
boolean debugEnabled )
|
||||
throws ModelInterpolationException
|
||||
|
@ -75,13 +75,13 @@ public class StringSearchModelInterpolator
|
|||
{
|
||||
List<ValueSource> valueSources = createValueSources( model, projectDir, config );
|
||||
List<InterpolationPostProcessor> postProcessors = createPostProcessors( model, projectDir, config );
|
||||
|
||||
|
||||
InterpolateObjectAction action =
|
||||
new InterpolateObjectAction( obj, valueSources, postProcessors, debugEnabled,
|
||||
this, getLogger() );
|
||||
|
||||
|
||||
ModelInterpolationException error = AccessController.doPrivileged( action );
|
||||
|
||||
|
||||
if ( error != null )
|
||||
{
|
||||
throw error;
|
||||
|
@ -97,10 +97,10 @@ public class StringSearchModelInterpolator
|
|||
{
|
||||
StringSearchInterpolator interpolator = new StringSearchInterpolator();
|
||||
interpolator.setCacheAnswers( true );
|
||||
|
||||
|
||||
return interpolator;
|
||||
}
|
||||
|
||||
|
||||
private static final class InterpolateObjectAction implements PrivilegedAction<ModelInterpolationException>
|
||||
{
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class StringSearchModelInterpolator
|
|||
private final Logger logger;
|
||||
private final List<ValueSource> valueSources;
|
||||
private final List<InterpolationPostProcessor> postProcessors;
|
||||
|
||||
|
||||
public InterpolateObjectAction( Object target, List<ValueSource> valueSources,
|
||||
List<InterpolationPostProcessor> postProcessors, boolean debugEnabled,
|
||||
StringSearchModelInterpolator modelInterpolator, Logger logger )
|
||||
|
@ -118,20 +118,20 @@ public class StringSearchModelInterpolator
|
|||
this.valueSources = valueSources;
|
||||
this.postProcessors = postProcessors;
|
||||
this.debugEnabled = debugEnabled;
|
||||
|
||||
|
||||
this.interpolationTargets = new LinkedList<Object>();
|
||||
interpolationTargets.add( target );
|
||||
|
||||
|
||||
this.modelInterpolator = modelInterpolator;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public ModelInterpolationException run()
|
||||
{
|
||||
while( !interpolationTargets.isEmpty() )
|
||||
while ( !interpolationTargets.isEmpty() )
|
||||
{
|
||||
Object obj = interpolationTargets.removeFirst();
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
traverseObjectWithParents( obj.getClass(), obj );
|
||||
|
@ -141,11 +141,11 @@ public class StringSearchModelInterpolator
|
|||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings( "unchecked" )
|
||||
private void traverseObjectWithParents( Class<?> cls, Object target )
|
||||
throws ModelInterpolationException
|
||||
{
|
||||
|
@ -153,8 +153,8 @@ public class StringSearchModelInterpolator
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( cls.isArray() )
|
||||
{
|
||||
evaluateArray( target );
|
||||
|
@ -167,7 +167,7 @@ public class StringSearchModelInterpolator
|
|||
fields = cls.getDeclaredFields();
|
||||
fieldsByClass.put( cls, fields );
|
||||
}
|
||||
|
||||
|
||||
for ( int i = 0; i < fields.length; i++ )
|
||||
{
|
||||
Class<?> type = fields[i].getType();
|
||||
|
@ -185,7 +185,7 @@ public class StringSearchModelInterpolator
|
|||
if ( value != null )
|
||||
{
|
||||
String interpolated = modelInterpolator.interpolateInternal( value, valueSources, postProcessors, debugEnabled );
|
||||
|
||||
|
||||
if ( !interpolated.equals( value ) )
|
||||
{
|
||||
fields[i].set( target, interpolated );
|
||||
|
@ -202,23 +202,28 @@ public class StringSearchModelInterpolator
|
|||
{
|
||||
c.clear();
|
||||
}
|
||||
catch( UnsupportedOperationException e )
|
||||
catch ( UnsupportedOperationException e )
|
||||
{
|
||||
if ( debugEnabled && logger != null )
|
||||
{
|
||||
logger.debug( "Skipping interpolation of field: " + fields[i] + " in: " + cls.getName() + "; it is an unmodifiable collection." );
|
||||
logger.debug( "Skipping interpolation of field: " + fields[i] + " in: "
|
||||
+ cls.getName() + "; it is an unmodifiable collection." );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for ( Object value : originalValues )
|
||||
{
|
||||
if ( value != null )
|
||||
{
|
||||
if( String.class == value.getClass() )
|
||||
if ( String.class == value.getClass() )
|
||||
{
|
||||
String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors, debugEnabled );
|
||||
|
||||
String interpolated =
|
||||
modelInterpolator.interpolateInternal( (String) value,
|
||||
valueSources,
|
||||
postProcessors,
|
||||
debugEnabled );
|
||||
|
||||
if ( !interpolated.equals( value ) )
|
||||
{
|
||||
c.add( interpolated );
|
||||
|
@ -257,24 +262,31 @@ public class StringSearchModelInterpolator
|
|||
for ( Map.Entry<Object, Object> entry : m.entrySet() )
|
||||
{
|
||||
Object value = entry.getValue();
|
||||
|
||||
|
||||
if ( value != null )
|
||||
{
|
||||
if( String.class == value.getClass() )
|
||||
if ( String.class == value.getClass() )
|
||||
{
|
||||
String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors, debugEnabled );
|
||||
|
||||
String interpolated =
|
||||
modelInterpolator.interpolateInternal( (String) value,
|
||||
valueSources,
|
||||
postProcessors,
|
||||
debugEnabled );
|
||||
|
||||
if ( !interpolated.equals( value ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
entry.setValue( interpolated );
|
||||
}
|
||||
catch( UnsupportedOperationException e )
|
||||
catch ( UnsupportedOperationException e )
|
||||
{
|
||||
if ( debugEnabled && logger != null )
|
||||
{
|
||||
logger.debug( "Skipping interpolation of field: " + fields[i] + " (key: " + entry.getKey() + ") in: " + cls.getName() + "; it is an unmodifiable collection." );
|
||||
logger.debug( "Skipping interpolation of field: "
|
||||
+ fields[i] + " (key: " + entry.getKey() + ") in: "
|
||||
+ cls.getName()
|
||||
+ "; it is an unmodifiable collection." );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -313,11 +325,13 @@ public class StringSearchModelInterpolator
|
|||
}
|
||||
catch ( IllegalArgumentException e )
|
||||
{
|
||||
throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i] + " on class: " + cls.getName(), e );
|
||||
throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i]
|
||||
+ " on class: " + cls.getName(), e );
|
||||
}
|
||||
catch ( IllegalAccessException e )
|
||||
{
|
||||
throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i] + " on class: " + cls.getName(), e );
|
||||
throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i]
|
||||
+ " on class: " + cls.getName(), e );
|
||||
}
|
||||
}
|
||||
finally
|
||||
|
@ -326,7 +340,7 @@ public class StringSearchModelInterpolator
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
traverseObjectWithParents( cls.getSuperclass(), target );
|
||||
}
|
||||
}
|
||||
|
@ -342,22 +356,22 @@ public class StringSearchModelInterpolator
|
|||
{
|
||||
fieldIsPrimitiveByClass.put( fieldType, Boolean.valueOf( fieldType.isPrimitive() ) );
|
||||
}
|
||||
|
||||
|
||||
if ( fieldIsPrimitiveByClass.get( fieldType ).booleanValue() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// if ( fieldType.isPrimitive() )
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
|
||||
if ( "parent".equals( field.getName() ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -365,15 +379,17 @@ public class StringSearchModelInterpolator
|
|||
throws ModelInterpolationException
|
||||
{
|
||||
int len = Array.getLength( target );
|
||||
for( int i = 0; i < len; i++ )
|
||||
for ( int i = 0; i < len; i++ )
|
||||
{
|
||||
Object value = Array.get( target, i );
|
||||
if ( value != null )
|
||||
{
|
||||
if ( String.class == value.getClass() )
|
||||
{
|
||||
String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors, debugEnabled );
|
||||
|
||||
String interpolated =
|
||||
modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors,
|
||||
debugEnabled );
|
||||
|
||||
if ( !interpolated.equals( value ) )
|
||||
{
|
||||
Array.set( target, i, interpolated );
|
||||
|
|
|
@ -21,7 +21,6 @@ package org.apache.maven.project.path;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.model.Build;
|
||||
|
@ -31,7 +30,7 @@ import org.apache.maven.model.Resource;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
@Deprecated
|
||||
@Component(role = PathTranslator.class)
|
||||
@Component( role = PathTranslator.class )
|
||||
public class DefaultPathTranslator
|
||||
implements PathTranslator
|
||||
{
|
||||
|
@ -49,27 +48,21 @@ public class DefaultPathTranslator
|
|||
|
||||
build.setTestSourceDirectory( alignToBaseDirectory( build.getTestSourceDirectory(), basedir ) );
|
||||
|
||||
for ( Iterator i = build.getResources().iterator(); i.hasNext(); )
|
||||
for ( Resource resource : build.getResources() )
|
||||
{
|
||||
Resource resource = (Resource) i.next();
|
||||
|
||||
resource.setDirectory( alignToBaseDirectory( resource.getDirectory(), basedir ) );
|
||||
}
|
||||
|
||||
for ( Iterator i = build.getTestResources().iterator(); i.hasNext(); )
|
||||
for ( Resource resource : build.getTestResources() )
|
||||
{
|
||||
Resource resource = (Resource) i.next();
|
||||
|
||||
resource.setDirectory( alignToBaseDirectory( resource.getDirectory(), basedir ) );
|
||||
}
|
||||
|
||||
if ( build.getFilters() != null )
|
||||
{
|
||||
List filters = new ArrayList();
|
||||
for ( Iterator i = build.getFilters().iterator(); i.hasNext(); )
|
||||
List<String> filters = new ArrayList<String>();
|
||||
for ( String filter : build.getFilters() )
|
||||
{
|
||||
String filter = (String) i.next();
|
||||
|
||||
filters.add( alignToBaseDirectory( filter, basedir ) );
|
||||
}
|
||||
build.setFilters( filters );
|
||||
|
@ -183,27 +176,21 @@ public class DefaultPathTranslator
|
|||
|
||||
build.setTestSourceDirectory( unalignFromBaseDirectory( build.getTestSourceDirectory(), basedir ) );
|
||||
|
||||
for ( Iterator i = build.getResources().iterator(); i.hasNext(); )
|
||||
for ( Resource resource : build.getResources() )
|
||||
{
|
||||
Resource resource = (Resource) i.next();
|
||||
|
||||
resource.setDirectory( unalignFromBaseDirectory( resource.getDirectory(), basedir ) );
|
||||
}
|
||||
|
||||
for ( Iterator i = build.getTestResources().iterator(); i.hasNext(); )
|
||||
for ( Resource resource : build.getTestResources() )
|
||||
{
|
||||
Resource resource = (Resource) i.next();
|
||||
|
||||
resource.setDirectory( unalignFromBaseDirectory( resource.getDirectory(), basedir ) );
|
||||
}
|
||||
|
||||
if ( build.getFilters() != null )
|
||||
{
|
||||
List filters = new ArrayList();
|
||||
for ( Iterator i = build.getFilters().iterator(); i.hasNext(); )
|
||||
List<String> filters = new ArrayList<String>();
|
||||
for ( String filter : build.getFilters() )
|
||||
{
|
||||
String filter = (String) i.next();
|
||||
|
||||
filters.add( unalignFromBaseDirectory( filter, basedir ) );
|
||||
}
|
||||
build.setFilters( filters );
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role = ModelValidator.class )
|
||||
@Component( role = ModelValidator.class )
|
||||
@Deprecated
|
||||
public class DefaultModelValidator
|
||||
implements ModelValidator
|
||||
|
|
|
@ -31,7 +31,7 @@ public class ModelValidationResult
|
|||
{
|
||||
|
||||
/** */
|
||||
private final static String NEWLINE = System.getProperty( "line.separator" );
|
||||
private static final String NEWLINE = System.getProperty( "line.separator" );
|
||||
|
||||
/** */
|
||||
private List<String> messages;
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.codehaus.plexus.util.StringUtils;
|
|||
@Component( role = MirrorSelector.class )
|
||||
public class DefaultMirrorSelector
|
||||
implements MirrorSelector
|
||||
{
|
||||
{
|
||||
|
||||
private static final String WILDCARD = "*";
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class DefaultMirrorSelector
|
|||
* This method checks if the pattern matches the originalRepository. Valid patterns: * =
|
||||
* everything external:* = everything not on the localhost and not file based. repo,repo1 = repo
|
||||
* or repo1 *,!repo1 = everything except repo1
|
||||
*
|
||||
*
|
||||
* @param originalRepository to compare for a match.
|
||||
* @param pattern used for match. Currently only '*' is supported.
|
||||
* @return true if the repository is a match to this pattern.
|
||||
|
@ -122,7 +122,7 @@ public class DefaultMirrorSelector
|
|||
|
||||
/**
|
||||
* Checks the URL to see if this repository refers to an external repository
|
||||
*
|
||||
*
|
||||
* @param originalRepository
|
||||
* @return true if external.
|
||||
*/
|
||||
|
@ -131,7 +131,8 @@ public class DefaultMirrorSelector
|
|||
try
|
||||
{
|
||||
URL url = new URL( originalRepository.getUrl() );
|
||||
return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" ) || url.getProtocol().equals( "file" ) );
|
||||
return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" )
|
||||
|| url.getProtocol().equals( "file" ) );
|
||||
}
|
||||
catch ( MalformedURLException e )
|
||||
{
|
||||
|
@ -147,7 +148,7 @@ public class DefaultMirrorSelector
|
|||
|
||||
/**
|
||||
* Checks whether the layouts configured for a mirror match with the layout of the repository.
|
||||
*
|
||||
*
|
||||
* @param repoLayout The layout of the repository, may be {@code null}.
|
||||
* @param mirrorLayout The layouts supported by the mirror, may be {@code null}.
|
||||
* @return {@code true} if the layouts associated with the mirror match the layout of the original repository,
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.repository;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
@ -37,7 +36,7 @@ public class MavenArtifactMetadata
|
|||
String classifier;
|
||||
String type;
|
||||
String scope;
|
||||
|
||||
|
||||
transient Object datum;
|
||||
|
||||
public String getGroupId()
|
||||
|
@ -109,14 +108,13 @@ public class MavenArtifactMetadata
|
|||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getGroupId()+":"+getArtifactId()+":"+getVersion()
|
||||
+":" + (getClassifier() == null ? "" : getClassifier() )
|
||||
+":" + (getType() == null ? DEFAULT_TYPE : getType() )
|
||||
;
|
||||
return getGroupId() + ":" + getArtifactId() + ":" + getVersion() + ":"
|
||||
+ ( getClassifier() == null ? "" : getClassifier() ) + ":"
|
||||
+ ( getType() == null ? DEFAULT_TYPE : getType() );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* This is the main graph data structure used by the RepositorySystem to present tree and graph objects.
|
||||
* This is the main graph data structure used by the RepositorySystem to present tree and graph objects.
|
||||
*
|
||||
* @author Oleg Gusakov
|
||||
* @version $Id$
|
||||
|
@ -36,14 +36,14 @@ public class MetadataGraph
|
|||
|
||||
/** entry point for tree-like structures */
|
||||
MetadataGraphNode entry;
|
||||
|
||||
|
||||
public MetadataGraph( MetadataGraphNode entry )
|
||||
{
|
||||
this();
|
||||
|
||||
|
||||
this.entry = entry;
|
||||
}
|
||||
|
||||
|
||||
public MetadataGraph()
|
||||
{
|
||||
nodes = new ArrayList<MetadataGraphNode>( 64 );
|
||||
|
@ -56,38 +56,38 @@ public class MetadataGraph
|
|||
|
||||
/**
|
||||
* find a node by the GAV (metadata)
|
||||
*
|
||||
*
|
||||
* @param md
|
||||
* @return
|
||||
*/
|
||||
public MetadataGraphNode findNode( MavenArtifactMetadata md )
|
||||
{
|
||||
for( MetadataGraphNode mgn : nodes )
|
||||
for ( MetadataGraphNode mgn : nodes )
|
||||
{
|
||||
if( mgn.metadata.equals( md ) )
|
||||
if ( mgn.metadata.equals( md ) )
|
||||
{
|
||||
return mgn;
|
||||
}
|
||||
}
|
||||
|
||||
MetadataGraphNode node = new MetadataGraphNode( md );
|
||||
addNode( node );
|
||||
addNode( node );
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getter
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public MetadataGraphNode getEntry()
|
||||
{
|
||||
return entry;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getter
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<MetadataGraphNode> getNodes()
|
||||
|
|
|
@ -32,32 +32,32 @@ import java.util.List;
|
|||
public class MetadataGraphNode
|
||||
{
|
||||
/** node payload */
|
||||
MavenArtifactMetadata metadata;
|
||||
MavenArtifactMetadata metadata;
|
||||
|
||||
/** nodes, incident to this (depend on me) */
|
||||
List<MetadataGraphNode> inNodes;
|
||||
|
||||
|
||||
/** nodes, exident to this (I depend on) */
|
||||
List<MetadataGraphNode> exNodes;
|
||||
|
||||
|
||||
public MetadataGraphNode()
|
||||
{
|
||||
inNodes = new ArrayList<MetadataGraphNode>(4);
|
||||
exNodes = new ArrayList<MetadataGraphNode>(8);
|
||||
}
|
||||
|
||||
|
||||
public MetadataGraphNode( MavenArtifactMetadata metadata )
|
||||
{
|
||||
this();
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
|
||||
public MetadataGraphNode addIncident( MetadataGraphNode node )
|
||||
{
|
||||
inNodes.add( node );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public MetadataGraphNode addExident( MetadataGraphNode node )
|
||||
{
|
||||
exNodes.add( node );
|
||||
|
@ -67,28 +67,36 @@ public class MetadataGraphNode
|
|||
@Override
|
||||
public boolean equals( Object obj )
|
||||
{
|
||||
if( obj == null )
|
||||
if ( obj == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( MetadataGraphNode.class.isAssignableFrom( obj.getClass() ) )
|
||||
if ( MetadataGraphNode.class.isAssignableFrom( obj.getClass() ) )
|
||||
{
|
||||
MetadataGraphNode node2 = (MetadataGraphNode) obj;
|
||||
|
||||
if( node2.metadata == null )
|
||||
|
||||
if ( node2.metadata == null )
|
||||
{
|
||||
return metadata == null;
|
||||
|
||||
return metadata == null ? false: metadata.toString().equals( node2.metadata.toString() );
|
||||
}
|
||||
|
||||
return metadata == null ? false : metadata.toString().equals( node2.metadata.toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.equals( obj );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
if( metadata == null )
|
||||
if ( metadata == null )
|
||||
{
|
||||
return super.hashCode();
|
||||
|
||||
}
|
||||
|
||||
return metadata.toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,32 +46,33 @@ public class MetadataResolutionRequest
|
|||
|
||||
private List<ArtifactRepository> remoteRepositories;
|
||||
|
||||
// This is like a filter but overrides all transitive versions
|
||||
// This is like a filter but overrides all transitive versions
|
||||
private Map managedVersionMap;
|
||||
|
||||
/** result type - flat list; the default */
|
||||
private boolean asList = true;
|
||||
|
||||
|
||||
/** result type - dirty tree */
|
||||
private boolean asDirtyTree = false;
|
||||
|
||||
|
||||
/** result type - resolved tree */
|
||||
private boolean asResolvedTree = false;
|
||||
|
||||
|
||||
/** result type - graph */
|
||||
private boolean asGraph = false;
|
||||
|
||||
|
||||
public MetadataResolutionRequest()
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
public MetadataResolutionRequest( MavenArtifactMetadata md, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
||||
{
|
||||
|
||||
public MetadataResolutionRequest( MavenArtifactMetadata md, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories )
|
||||
{
|
||||
this.mad = md;
|
||||
this.localRepository = localRepository;
|
||||
this.remoteRepositories = remoteRepositories;
|
||||
}
|
||||
|
||||
|
||||
public MavenArtifactMetadata getArtifactMetadata()
|
||||
{
|
||||
return mad;
|
||||
|
@ -141,7 +142,7 @@ public class MetadataResolutionRequest
|
|||
.append( "localRepository: " ).append( localRepository ).append( "\n" )
|
||||
.append( "remoteRepositories: " ).append( remoteRepositories ).append( "\n" )
|
||||
;
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,6 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
|||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||
import org.apache.maven.artifact.resolver.CyclicDependencyException;
|
||||
import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
|
||||
import org.apache.maven.repository.legacy.resolver.DefaultLegacyArtifactCollector;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -65,11 +63,11 @@ public class MetadataResolutionResult
|
|||
private Set<Artifact> requestedArtifacts;
|
||||
|
||||
private Set<Artifact> artifacts;
|
||||
|
||||
|
||||
private MetadataGraph dirtyTree;
|
||||
|
||||
|
||||
private MetadataGraph resolvedTree;
|
||||
|
||||
|
||||
private MetadataGraph resolvedGraph;
|
||||
|
||||
public Artifact getOriginatingArtifact()
|
||||
|
@ -235,8 +233,10 @@ public class MetadataResolutionResult
|
|||
|
||||
public MetadataResolutionResult addError( Exception e )
|
||||
{
|
||||
if( exceptions == null )
|
||||
if ( exceptions == null )
|
||||
{
|
||||
initList( exceptions );
|
||||
}
|
||||
|
||||
exceptions.add( e );
|
||||
|
||||
|
@ -353,5 +353,5 @@ public class MetadataResolutionResult
|
|||
{
|
||||
this.resolvedTree = resolvedTree;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -35,25 +35,23 @@ public class VersionNotFoundException
|
|||
extends Exception
|
||||
{
|
||||
private Dependency dependency;
|
||||
|
||||
|
||||
private String projectId;
|
||||
private File pomFile;
|
||||
private InvalidVersionSpecificationException cause;
|
||||
private InvalidVersionSpecificationException cause;
|
||||
|
||||
public VersionNotFoundException( String projectId
|
||||
, Dependency dependency
|
||||
, File pomFile
|
||||
, InvalidVersionSpecificationException cause
|
||||
)
|
||||
public VersionNotFoundException( String projectId, Dependency dependency, File pomFile,
|
||||
InvalidVersionSpecificationException cause )
|
||||
{
|
||||
super( projectId+", "+formatLocationInPom( dependency )+ " " +dependency.getVersion()+", pom file "+pomFile, cause );
|
||||
|
||||
super( projectId + ", " + formatLocationInPom( dependency ) + " " + dependency.getVersion() + ", pom file "
|
||||
+ pomFile, cause );
|
||||
|
||||
this.projectId = projectId;
|
||||
|
||||
|
||||
this.pomFile = pomFile;
|
||||
|
||||
|
||||
this.cause = cause;
|
||||
|
||||
|
||||
this.dependency = dependency;
|
||||
}
|
||||
|
||||
|
@ -81,6 +79,6 @@ public class VersionNotFoundException
|
|||
{
|
||||
return cause;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
|
||||
@Component(role=UpdateCheckManager.class)
|
||||
@Component( role = UpdateCheckManager.class )
|
||||
public class DefaultUpdateCheckManager
|
||||
extends AbstractLogEnabled
|
||||
implements UpdateCheckManager
|
||||
|
@ -390,7 +390,8 @@ public class DefaultUpdateCheckManager
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
getLogger().debug( "Error releasing shared lock for resolution tracking file: " + touchfile, e );
|
||||
getLogger().debug( "Error releasing shared lock for resolution tracking file: " + touchfile,
|
||||
e );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ import org.codehaus.plexus.util.FileUtils;
|
|||
|
||||
//TODO: remove the update check manager
|
||||
//TODO: separate into retriever and publisher
|
||||
//TODO: rmeove hardcoding of checksum logic
|
||||
@Component(role = WagonManager.class)
|
||||
//TODO: remove hardcoding of checksum logic
|
||||
@Component( role = WagonManager.class )
|
||||
public class DefaultWagonManager
|
||||
implements WagonManager
|
||||
{
|
||||
|
@ -74,8 +74,9 @@ public class DefaultWagonManager
|
|||
|
||||
//
|
||||
// Retriever
|
||||
//
|
||||
public void getArtifact( Artifact artifact, ArtifactRepository repository, TransferListener downloadMonitor, boolean force )
|
||||
//
|
||||
public void getArtifact( Artifact artifact, ArtifactRepository repository, TransferListener downloadMonitor,
|
||||
boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException
|
||||
{
|
||||
String remotePath = repository.pathOf( artifact );
|
||||
|
@ -138,7 +139,8 @@ public class DefaultWagonManager
|
|||
}
|
||||
}
|
||||
|
||||
public void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories, TransferListener downloadMonitor, boolean force )
|
||||
public void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
TransferListener downloadMonitor, boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException
|
||||
{
|
||||
TransferFailedException tfe = null;
|
||||
|
@ -195,7 +197,8 @@ public class DefaultWagonManager
|
|||
}
|
||||
}
|
||||
|
||||
public void getArtifactMetadata( ArtifactMetadata metadata, ArtifactRepository repository, File destination, String checksumPolicy )
|
||||
public void getArtifactMetadata( ArtifactMetadata metadata, ArtifactRepository repository, File destination,
|
||||
String checksumPolicy )
|
||||
throws TransferFailedException, ResourceDoesNotExistException
|
||||
{
|
||||
String remotePath = repository.pathOfRemoteRepositoryMetadata( metadata );
|
||||
|
@ -203,7 +206,8 @@ public class DefaultWagonManager
|
|||
getRemoteFile( repository, destination, remotePath, null, checksumPolicy, true );
|
||||
}
|
||||
|
||||
public void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository repository, File destination, String checksumPolicy )
|
||||
public void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository repository,
|
||||
File destination, String checksumPolicy )
|
||||
throws TransferFailedException, ResourceDoesNotExistException
|
||||
{
|
||||
String remotePath = repository.pathOfRemoteRepositoryMetadata( metadata );
|
||||
|
@ -213,13 +217,13 @@ public class DefaultWagonManager
|
|||
|
||||
/**
|
||||
* Deal with connecting to a wagon repository taking into account authentication and proxies.
|
||||
*
|
||||
*
|
||||
* @param wagon
|
||||
* @param repository
|
||||
* @throws ConnectionException
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
private void connectWagon( Wagon wagon, ArtifactRepository repository )
|
||||
private void connectWagon( Wagon wagon, ArtifactRepository repository )
|
||||
throws ConnectionException, AuthenticationException
|
||||
{
|
||||
if ( repository.getProxy() != null && logger.isDebugEnabled() )
|
||||
|
@ -235,7 +239,8 @@ public class DefaultWagonManager
|
|||
}
|
||||
else if ( repository.getAuthentication() != null )
|
||||
{
|
||||
wagon.connect( new Repository( repository.getId(), repository.getUrl() ), authenticationInfo( repository ) );
|
||||
wagon.connect( new Repository( repository.getId(), repository.getUrl() ),
|
||||
authenticationInfo( repository ) );
|
||||
}
|
||||
else if ( repository.getProxy() != null )
|
||||
{
|
||||
|
@ -245,16 +250,16 @@ public class DefaultWagonManager
|
|||
{
|
||||
wagon.connect( new Repository( repository.getId(), repository.getUrl() ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private AuthenticationInfo authenticationInfo( ArtifactRepository repository )
|
||||
{
|
||||
AuthenticationInfo ai = new AuthenticationInfo();
|
||||
ai.setUserName( repository.getAuthentication().getUsername() );
|
||||
ai.setPassword( repository.getAuthentication().getPassword() );
|
||||
return ai;
|
||||
return ai;
|
||||
}
|
||||
|
||||
|
||||
private ProxyInfo proxyInfo( ArtifactRepository repository )
|
||||
{
|
||||
ProxyInfo proxyInfo = new ProxyInfo();
|
||||
|
@ -263,11 +268,12 @@ public class DefaultWagonManager
|
|||
proxyInfo.setPort( repository.getProxy().getPort() );
|
||||
proxyInfo.setNonProxyHosts( repository.getProxy().getNonProxyHosts() );
|
||||
proxyInfo.setUserName( repository.getProxy().getUserName() );
|
||||
proxyInfo.setPassword( repository.getProxy().getPassword() );
|
||||
proxyInfo.setPassword( repository.getProxy().getPassword() );
|
||||
return proxyInfo;
|
||||
}
|
||||
|
||||
public void getRemoteFile( ArtifactRepository repository, File destination, String remotePath, TransferListener downloadMonitor, String checksumPolicy, boolean force )
|
||||
|
||||
public void getRemoteFile( ArtifactRepository repository, File destination, String remotePath,
|
||||
TransferListener downloadMonitor, String checksumPolicy, boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException
|
||||
{
|
||||
String protocol = repository.getProtocol();
|
||||
|
@ -297,7 +303,7 @@ public class DefaultWagonManager
|
|||
try
|
||||
{
|
||||
connectWagon( wagon, repository );
|
||||
|
||||
|
||||
boolean firstRun = true;
|
||||
boolean retry = true;
|
||||
|
||||
|
@ -407,7 +413,8 @@ public class DefaultWagonManager
|
|||
catch ( ResourceDoesNotExistException md5TryException )
|
||||
{
|
||||
// this was a failed transfer, and we don't want to retry.
|
||||
handleChecksumFailure( checksumPolicy, "Error retrieving checksum file for " + remotePath, md5TryException );
|
||||
handleChecksumFailure( checksumPolicy, "Error retrieving checksum file for " + remotePath,
|
||||
md5TryException );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -470,7 +477,8 @@ public class DefaultWagonManager
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new TransferFailedException( "Error copying temporary file to the final destination: " + e.getMessage(), e );
|
||||
throw new TransferFailedException( "Error copying temporary file to the final destination: "
|
||||
+ e.getMessage(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -478,8 +486,9 @@ public class DefaultWagonManager
|
|||
|
||||
//
|
||||
// Publisher
|
||||
//
|
||||
public void putArtifact( File source, Artifact artifact, ArtifactRepository deploymentRepository, TransferListener downloadMonitor )
|
||||
//
|
||||
public void putArtifact( File source, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
TransferListener downloadMonitor )
|
||||
throws TransferFailedException
|
||||
{
|
||||
putRemoteFile( deploymentRepository, source, deploymentRepository.pathOf( artifact ), downloadMonitor );
|
||||
|
@ -492,7 +501,8 @@ public class DefaultWagonManager
|
|||
putRemoteFile( repository, source, repository.pathOfRemoteRepositoryMetadata( artifactMetadata ), null );
|
||||
}
|
||||
|
||||
public void putRemoteFile( ArtifactRepository repository, File source, String remotePath, TransferListener downloadMonitor )
|
||||
public void putRemoteFile( ArtifactRepository repository, File source, String remotePath,
|
||||
TransferListener downloadMonitor )
|
||||
throws TransferFailedException
|
||||
{
|
||||
String protocol = repository.getProtocol();
|
||||
|
@ -521,7 +531,7 @@ public class DefaultWagonManager
|
|||
{
|
||||
checksums.put( CHECKSUM_IDS[i], addChecksumObserver( wagon, CHECKSUM_ALGORITHMS[i] ) );
|
||||
}
|
||||
|
||||
|
||||
List<File> temporaryFiles = new ArrayList<File>();
|
||||
|
||||
try
|
||||
|
@ -583,7 +593,7 @@ public class DefaultWagonManager
|
|||
{
|
||||
// MNG-4543
|
||||
cleanupTemporaryFiles( temporaryFiles );
|
||||
|
||||
|
||||
// Remove every checksum listener
|
||||
for ( String aCHECKSUM_IDS : CHECKSUM_IDS )
|
||||
{
|
||||
|
@ -600,7 +610,7 @@ public class DefaultWagonManager
|
|||
}
|
||||
}
|
||||
|
||||
private void cleanupTemporaryFiles(List<File> files)
|
||||
private void cleanupTemporaryFiles( List<File> files )
|
||||
{
|
||||
for ( File file : files )
|
||||
{
|
||||
|
@ -615,9 +625,9 @@ public class DefaultWagonManager
|
|||
+ e.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private ChecksumObserver addChecksumObserver( Wagon wagon, String algorithm )
|
||||
throws TransferFailedException
|
||||
{
|
||||
|
@ -648,7 +658,8 @@ public class DefaultWagonManager
|
|||
// otherwise it is ignore
|
||||
}
|
||||
|
||||
private void verifyChecksum( ChecksumObserver checksumObserver, File destination, File tempDestination, String remotePath, String checksumFileExtension, Wagon wagon )
|
||||
private void verifyChecksum( ChecksumObserver checksumObserver, File destination, File tempDestination,
|
||||
String remotePath, String checksumFileExtension, Wagon wagon )
|
||||
throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException
|
||||
{
|
||||
try
|
||||
|
@ -666,7 +677,8 @@ public class DefaultWagonManager
|
|||
expectedChecksum = expectedChecksum.trim();
|
||||
|
||||
// check for 'ALGO (name) = CHECKSUM' like used by openssl
|
||||
if ( expectedChecksum.regionMatches( true, 0, "MD", 0, 2 ) || expectedChecksum.regionMatches( true, 0, "SHA", 0, 3 ) )
|
||||
if ( expectedChecksum.regionMatches( true, 0, "MD", 0, 2 )
|
||||
|| expectedChecksum.regionMatches( true, 0, "SHA", 0, 3 ) )
|
||||
{
|
||||
int lastSpacePos = expectedChecksum.lastIndexOf( ' ' );
|
||||
expectedChecksum = expectedChecksum.substring( lastSpacePos + 1 );
|
||||
|
@ -693,7 +705,8 @@ public class DefaultWagonManager
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new ChecksumFailedException( "Checksum failed on download: local = '" + actualChecksum + "'; remote = '" + expectedChecksum + "'" );
|
||||
throw new ChecksumFailedException( "Checksum failed on download: local = '" + actualChecksum
|
||||
+ "'; remote = '" + expectedChecksum + "'" );
|
||||
}
|
||||
}
|
||||
catch ( IOException e )
|
||||
|
@ -732,8 +745,8 @@ public class DefaultWagonManager
|
|||
throws UnsupportedProtocolException
|
||||
{
|
||||
return getWagon( repository.getProtocol() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Wagon getWagon( String protocol )
|
||||
throws UnsupportedProtocolException
|
||||
|
@ -758,5 +771,5 @@ public class DefaultWagonManager
|
|||
|
||||
return wagon;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.repository.legacy;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -70,7 +74,7 @@ import org.codehaus.plexus.util.StringUtils;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role = RepositorySystem.class, hint = "default")
|
||||
@Component( role = RepositorySystem.class, hint = "default" )
|
||||
public class LegacyRepositorySystem
|
||||
implements RepositorySystem
|
||||
{
|
||||
|
@ -112,7 +116,8 @@ public class LegacyRepositorySystem
|
|||
return artifactFactory.createBuildArtifact( groupId, artifactId, version, packaging );
|
||||
}
|
||||
|
||||
public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, String classifier )
|
||||
public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type,
|
||||
String classifier )
|
||||
{
|
||||
return artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier );
|
||||
}
|
||||
|
@ -134,7 +139,9 @@ public class LegacyRepositorySystem
|
|||
return null;
|
||||
}
|
||||
|
||||
Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), d.getClassifier(), d.getScope(), d.isOptional() );
|
||||
Artifact artifact =
|
||||
artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(),
|
||||
d.getClassifier(), d.getScope(), d.isOptional() );
|
||||
|
||||
if ( Artifact.SCOPE_SYSTEM.equals( d.getScope() ) && d.getSystemPath() != null )
|
||||
{
|
||||
|
@ -225,8 +232,11 @@ public class LegacyRepositorySystem
|
|||
public ArtifactRepository createLocalRepository( File localRepository )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
return createRepository( "file://" + localRepository.toURI().getRawPath(), RepositorySystem.DEFAULT_LOCAL_REPO_ID, true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
|
||||
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
|
||||
return createRepository( "file://" + localRepository.toURI().getRawPath(),
|
||||
RepositorySystem.DEFAULT_LOCAL_REPO_ID, true,
|
||||
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
|
||||
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
|
||||
ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
|
||||
}
|
||||
|
||||
public ArtifactRepository createDefaultRemoteRepository()
|
||||
|
@ -241,7 +251,9 @@ public class LegacyRepositorySystem
|
|||
public ArtifactRepository createLocalRepository( String url, String repositoryId )
|
||||
throws IOException
|
||||
{
|
||||
return createRepository( canonicalFileUrl( url ), repositoryId, true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
|
||||
return createRepository( canonicalFileUrl( url ), repositoryId, true,
|
||||
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
|
||||
ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
|
||||
ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
|
||||
}
|
||||
|
||||
|
@ -278,15 +290,17 @@ public class LegacyRepositorySystem
|
|||
{
|
||||
/*
|
||||
* Probably is not worth it, but here I make sure I restore request
|
||||
* to its original state.
|
||||
* to its original state.
|
||||
*/
|
||||
try
|
||||
{
|
||||
LocalArtifactRepository ideWorkspace = plexus.lookup( LocalArtifactRepository.class, LocalArtifactRepository.IDE_WORKSPACE );
|
||||
LocalArtifactRepository ideWorkspace =
|
||||
plexus.lookup( LocalArtifactRepository.class, LocalArtifactRepository.IDE_WORKSPACE );
|
||||
|
||||
if ( request.getLocalRepository() instanceof DelegatingLocalArtifactRepository )
|
||||
{
|
||||
DelegatingLocalArtifactRepository delegatingLocalRepository = (DelegatingLocalArtifactRepository) request.getLocalRepository();
|
||||
DelegatingLocalArtifactRepository delegatingLocalRepository =
|
||||
(DelegatingLocalArtifactRepository) request.getLocalRepository();
|
||||
|
||||
LocalArtifactRepository orig = delegatingLocalRepository.getIdeWorspace();
|
||||
|
||||
|
@ -304,7 +318,8 @@ public class LegacyRepositorySystem
|
|||
else
|
||||
{
|
||||
ArtifactRepository localRepository = request.getLocalRepository();
|
||||
DelegatingLocalArtifactRepository delegatingLocalRepository = new DelegatingLocalArtifactRepository( localRepository );
|
||||
DelegatingLocalArtifactRepository delegatingLocalRepository =
|
||||
new DelegatingLocalArtifactRepository( localRepository );
|
||||
delegatingLocalRepository.setIdeWorkspace( ideWorkspace );
|
||||
request.setLocalRepository( delegatingLocalRepository );
|
||||
try
|
||||
|
@ -370,7 +385,8 @@ public class LegacyRepositorySystem
|
|||
|
||||
for ( List<ArtifactRepository> aliasedRepos : reposByKey.values() )
|
||||
{
|
||||
List<ArtifactRepositoryPolicy> releasePolicies = new ArrayList<ArtifactRepositoryPolicy>( aliasedRepos.size() );
|
||||
List<ArtifactRepositoryPolicy> releasePolicies =
|
||||
new ArrayList<ArtifactRepositoryPolicy>( aliasedRepos.size() );
|
||||
|
||||
for ( ArtifactRepository aliasedRepo : aliasedRepos )
|
||||
{
|
||||
|
@ -379,7 +395,8 @@ public class LegacyRepositorySystem
|
|||
|
||||
ArtifactRepositoryPolicy releasePolicy = getEffectivePolicy( releasePolicies );
|
||||
|
||||
List<ArtifactRepositoryPolicy> snapshotPolicies = new ArrayList<ArtifactRepositoryPolicy>( aliasedRepos.size() );
|
||||
List<ArtifactRepositoryPolicy> snapshotPolicies =
|
||||
new ArrayList<ArtifactRepositoryPolicy>( aliasedRepos.size() );
|
||||
|
||||
for ( ArtifactRepository aliasedRepo : aliasedRepos )
|
||||
{
|
||||
|
@ -390,8 +407,9 @@ public class LegacyRepositorySystem
|
|||
|
||||
ArtifactRepository aliasedRepo = aliasedRepos.get( 0 );
|
||||
|
||||
ArtifactRepository effectiveRepository =
|
||||
createArtifactRepository( aliasedRepo.getId(), aliasedRepo.getUrl(), aliasedRepo.getLayout(), snapshotPolicy, releasePolicy );
|
||||
ArtifactRepository effectiveRepository =
|
||||
createArtifactRepository( aliasedRepo.getId(), aliasedRepo.getUrl(), aliasedRepo.getLayout(),
|
||||
snapshotPolicy, releasePolicy );
|
||||
|
||||
effectiveRepository.setAuthentication( aliasedRepo.getAuthentication() );
|
||||
|
||||
|
@ -567,11 +585,12 @@ public class LegacyRepositorySystem
|
|||
// List<ResolutionListener> listeners,
|
||||
// List<ConflictResolver> conflictResolvers )
|
||||
// ArtifactResolutionResult result = artifactCollector.
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void retrieve( ArtifactRepository repository, File destination, String remotePath, ArtifactTransferListener transferListener )
|
||||
public void retrieve( ArtifactRepository repository, File destination, String remotePath,
|
||||
ArtifactTransferListener transferListener )
|
||||
throws ArtifactTransferFailedException, ArtifactDoesNotExistException
|
||||
{
|
||||
try
|
||||
|
@ -590,7 +609,8 @@ public class LegacyRepositorySystem
|
|||
}
|
||||
}
|
||||
|
||||
public void publish( ArtifactRepository repository, File source, String remotePath, ArtifactTransferListener transferListener )
|
||||
public void publish( ArtifactRepository repository, File source, String remotePath,
|
||||
ArtifactTransferListener transferListener )
|
||||
throws ArtifactTransferFailedException
|
||||
{
|
||||
try
|
||||
|
@ -609,7 +629,7 @@ public class LegacyRepositorySystem
|
|||
//
|
||||
public ArtifactRepository buildArtifactRepository( Repository repo )
|
||||
throws InvalidRepositoryException
|
||||
{
|
||||
{
|
||||
if ( repo != null )
|
||||
{
|
||||
String id = repo.getId();
|
||||
|
@ -629,7 +649,7 @@ public class LegacyRepositorySystem
|
|||
ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots() );
|
||||
|
||||
ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases() );
|
||||
|
||||
|
||||
return createArtifactRepository( id, url, layouts.get( repo.getLayout() ), snapshots, releases );
|
||||
}
|
||||
else
|
||||
|
@ -637,24 +657,33 @@ public class LegacyRepositorySystem
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private ArtifactRepository createRepository( String url, String repositoryId, boolean releases, String releaseUpdates, boolean snapshots, String snapshotUpdates, String checksumPolicy )
|
||||
{
|
||||
ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy( snapshots, snapshotUpdates, checksumPolicy );
|
||||
|
||||
ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy( releases, releaseUpdates, checksumPolicy );
|
||||
private ArtifactRepository createRepository( String url, String repositoryId, boolean releases,
|
||||
String releaseUpdates, boolean snapshots, String snapshotUpdates,
|
||||
String checksumPolicy )
|
||||
{
|
||||
ArtifactRepositoryPolicy snapshotsPolicy =
|
||||
new ArtifactRepositoryPolicy( snapshots, snapshotUpdates, checksumPolicy );
|
||||
|
||||
ArtifactRepositoryPolicy releasesPolicy =
|
||||
new ArtifactRepositoryPolicy( releases, releaseUpdates, checksumPolicy );
|
||||
|
||||
return createArtifactRepository( repositoryId, url, null, snapshotsPolicy, releasesPolicy );
|
||||
}
|
||||
|
||||
public ArtifactRepository createArtifactRepository( String repositoryId, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
public ArtifactRepository createArtifactRepository( String repositoryId, String url,
|
||||
ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases )
|
||||
{
|
||||
if ( repositoryLayout == null )
|
||||
{
|
||||
repositoryLayout = layouts.get( "default" );
|
||||
}
|
||||
|
||||
ArtifactRepository artifactRepository = artifactRepositoryFactory.createArtifactRepository( repositoryId, url, repositoryLayout, snapshots, releases );
|
||||
ArtifactRepository artifactRepository =
|
||||
artifactRepositoryFactory.createArtifactRepository( repositoryId, url, repositoryLayout, snapshots,
|
||||
releases );
|
||||
|
||||
return artifactRepository;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.repository.legacy;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -21,7 +25,6 @@ import java.util.List;
|
|||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadata;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.repository.ArtifactTransferListener;
|
||||
import org.apache.maven.wagon.ResourceDoesNotExistException;
|
||||
import org.apache.maven.wagon.TransferFailedException;
|
||||
import org.apache.maven.wagon.UnsupportedProtocolException;
|
||||
|
@ -41,26 +44,31 @@ public interface WagonManager
|
|||
|
||||
//
|
||||
// Retriever
|
||||
//
|
||||
//
|
||||
void getArtifact( Artifact artifact, ArtifactRepository repository, TransferListener transferListener, boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories, TransferListener transferListener, boolean force )
|
||||
void getArtifact( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
TransferListener transferListener, boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
void getRemoteFile( ArtifactRepository repository, File destination, String remotePath, TransferListener downloadMonitor, String checksumPolicy, boolean force )
|
||||
void getRemoteFile( ArtifactRepository repository, File destination, String remotePath,
|
||||
TransferListener downloadMonitor, String checksumPolicy, boolean force )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
void getArtifactMetadata( ArtifactMetadata metadata, ArtifactRepository remoteRepository, File destination, String checksumPolicy )
|
||||
void getArtifactMetadata( ArtifactMetadata metadata, ArtifactRepository remoteRepository, File destination,
|
||||
String checksumPolicy )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository remoteRepository, File file, String checksumPolicyWarn )
|
||||
void getArtifactMetadataFromDeploymentRepository( ArtifactMetadata metadata, ArtifactRepository remoteRepository,
|
||||
File file, String checksumPolicyWarn )
|
||||
throws TransferFailedException, ResourceDoesNotExistException;
|
||||
|
||||
//
|
||||
// Deployer
|
||||
//
|
||||
void putArtifact( File source, Artifact artifact, ArtifactRepository deploymentRepository, TransferListener downloadMonitor )
|
||||
void putArtifact( File source, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
TransferListener downloadMonitor )
|
||||
throws TransferFailedException;
|
||||
|
||||
void putRemoteFile( ArtifactRepository repository, File source, String remotePath, TransferListener downloadMonitor )
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven.repository.legacy.repository;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.UnknownRepositoryLayoutException;
|
||||
|
@ -36,12 +40,15 @@ public interface ArtifactRepositoryFactory
|
|||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId, boolean uniqueVersion )
|
||||
throws UnknownRepositoryLayoutException;
|
||||
|
||||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, ArtifactRepositoryLayout layout, boolean uniqueVersion );
|
||||
ArtifactRepository createDeploymentArtifactRepository( String id, String url, ArtifactRepositoryLayout layout,
|
||||
boolean uniqueVersion );
|
||||
|
||||
ArtifactRepository createArtifactRepository( String id, String url, String layoutId, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
ArtifactRepository createArtifactRepository( String id, String url, String layoutId,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases )
|
||||
throws UnknownRepositoryLayoutException;
|
||||
|
||||
ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
|
||||
ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases );
|
||||
|
||||
void setGlobalUpdatePolicy( String snapshotPolicy );
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
/**
|
||||
* @author jdcasey
|
||||
*/
|
||||
@Component(role=ArtifactRepositoryFactory.class)
|
||||
@Component( role = ArtifactRepositoryFactory.class )
|
||||
public class DefaultArtifactRepositoryFactory
|
||||
implements ArtifactRepositoryFactory
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class DefaultArtifactRepositoryFactory
|
|||
|
||||
private String globalChecksumPolicy;
|
||||
|
||||
@Requirement(role=ArtifactRepositoryLayout.class)
|
||||
@Requirement( role = ArtifactRepositoryLayout.class )
|
||||
private Map<String,ArtifactRepositoryLayout> repositoryLayouts;
|
||||
|
||||
public ArtifactRepositoryLayout getLayout( String layoutId )
|
||||
|
@ -51,9 +51,7 @@ public class DefaultArtifactRepositoryFactory
|
|||
return repositoryLayouts.get( layoutId );
|
||||
}
|
||||
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id,
|
||||
String url,
|
||||
String layoutId,
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id, String url, String layoutId,
|
||||
boolean uniqueVersion )
|
||||
throws UnknownRepositoryLayoutException
|
||||
{
|
||||
|
@ -64,9 +62,7 @@ public class DefaultArtifactRepositoryFactory
|
|||
return createDeploymentArtifactRepository( id, url, layout, uniqueVersion );
|
||||
}
|
||||
|
||||
private void checkLayout( String repositoryId,
|
||||
String layoutId,
|
||||
ArtifactRepositoryLayout layout )
|
||||
private void checkLayout( String repositoryId, String layoutId, ArtifactRepositoryLayout layout )
|
||||
throws UnknownRepositoryLayoutException
|
||||
{
|
||||
if ( layout == null )
|
||||
|
@ -75,17 +71,14 @@ public class DefaultArtifactRepositoryFactory
|
|||
}
|
||||
}
|
||||
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id,
|
||||
String url,
|
||||
public ArtifactRepository createDeploymentArtifactRepository( String id, String url,
|
||||
ArtifactRepositoryLayout repositoryLayout,
|
||||
boolean uniqueVersion )
|
||||
{
|
||||
return createArtifactRepository( id, url, repositoryLayout, null, null );
|
||||
}
|
||||
|
||||
public ArtifactRepository createArtifactRepository( String id,
|
||||
String url,
|
||||
String layoutId,
|
||||
public ArtifactRepository createArtifactRepository( String id, String url, String layoutId,
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases )
|
||||
throws UnknownRepositoryLayoutException
|
||||
|
@ -97,8 +90,7 @@ public class DefaultArtifactRepositoryFactory
|
|||
return createArtifactRepository( id, url, layout, snapshots, releases );
|
||||
}
|
||||
|
||||
public ArtifactRepository createArtifactRepository( String id,
|
||||
String url,
|
||||
public ArtifactRepository createArtifactRepository( String id, String url,
|
||||
ArtifactRepositoryLayout repositoryLayout,
|
||||
ArtifactRepositoryPolicy snapshots,
|
||||
ArtifactRepositoryPolicy releases )
|
||||
|
|
|
@ -59,7 +59,7 @@ import org.codehaus.plexus.logging.Logger;
|
|||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role=LegacyArtifactCollector.class)
|
||||
@Component( role = LegacyArtifactCollector.class )
|
||||
public class DefaultLegacyArtifactCollector
|
||||
implements LegacyArtifactCollector
|
||||
{
|
||||
|
@ -87,13 +87,10 @@ public class DefaultLegacyArtifactCollector
|
|||
}
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult collect( Set<Artifact> artifacts,
|
||||
Artifact originatingArtifact,
|
||||
Map managedVersions,
|
||||
ArtifactRepository localRepository,
|
||||
public ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source,
|
||||
ArtifactFilter filter,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers )
|
||||
{
|
||||
|
@ -105,12 +102,9 @@ public class DefaultLegacyArtifactCollector
|
|||
conflictResolvers );
|
||||
}
|
||||
|
||||
public ArtifactResolutionResult collect( Set<Artifact> artifacts,
|
||||
Artifact originatingArtifact,
|
||||
Map managedVersions,
|
||||
ArtifactResolutionRequest repositoryRequest,
|
||||
ArtifactMetadataSource source,
|
||||
ArtifactFilter filter,
|
||||
public ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactResolutionRequest repositoryRequest,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers )
|
||||
{
|
||||
|
@ -148,7 +142,8 @@ public class DefaultLegacyArtifactCollector
|
|||
|
||||
try
|
||||
{
|
||||
recurse( result, root, resolvedArtifacts, versionMap, repositoryRequest, source, filter, listeners, conflictResolvers );
|
||||
recurse( result, root, resolvedArtifacts, versionMap, repositoryRequest, source, filter, listeners,
|
||||
conflictResolvers );
|
||||
}
|
||||
catch ( CyclicDependencyException e )
|
||||
{
|
||||
|
@ -187,7 +182,7 @@ public class DefaultLegacyArtifactCollector
|
|||
artifact.setDependencyTrail( node.getDependencyTrail() );
|
||||
|
||||
set.add( node );
|
||||
|
||||
|
||||
// This is required right now.
|
||||
result.addArtifact( artifact );
|
||||
}
|
||||
|
@ -242,15 +237,10 @@ public class DefaultLegacyArtifactCollector
|
|||
return versionMap;
|
||||
}
|
||||
|
||||
private void recurse( ArtifactResolutionResult result,
|
||||
ResolutionNode node,
|
||||
Map<Object, List<ResolutionNode>> resolvedArtifacts,
|
||||
ManagedVersionMap managedVersions,
|
||||
ArtifactResolutionRequest request,
|
||||
ArtifactMetadataSource source,
|
||||
ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers )
|
||||
private void recurse( ArtifactResolutionResult result, ResolutionNode node,
|
||||
Map<Object, List<ResolutionNode>> resolvedArtifacts, ManagedVersionMap managedVersions,
|
||||
ArtifactResolutionRequest request, ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners, List<ConflictResolver> conflictResolvers )
|
||||
throws ArtifactResolutionException
|
||||
{
|
||||
fireEvent( ResolutionListener.TEST_ARTIFACT, listeners, node );
|
||||
|
@ -324,13 +314,17 @@ public class DefaultLegacyArtifactCollector
|
|||
catch ( ArtifactMetadataRetrievalException e )
|
||||
{
|
||||
resetArtifact.setDependencyTrail( node.getDependencyTrail() );
|
||||
throw new ArtifactResolutionException( "Unable to get dependency information: " + e.getMessage(), resetArtifact, request.getRemoteRepositories(), e );
|
||||
throw new ArtifactResolutionException(
|
||||
"Unable to get dependency information: "
|
||||
+ e.getMessage(), resetArtifact,
|
||||
request.getRemoteRepositories(), e );
|
||||
}
|
||||
}
|
||||
// end hack
|
||||
|
||||
// MNG-2861: match version can return null
|
||||
ArtifactVersion selectedVersion = resetArtifact.getVersionRange().matchVersion( resetArtifact.getAvailableVersions() );
|
||||
ArtifactVersion selectedVersion =
|
||||
resetArtifact.getVersionRange().matchVersion( resetArtifact.getAvailableVersions() );
|
||||
if ( selectedVersion != null )
|
||||
{
|
||||
resetArtifact.selectVersion( selectedVersion.toString() );
|
||||
|
@ -359,15 +353,19 @@ public class DefaultLegacyArtifactCollector
|
|||
if ( resolved == null )
|
||||
{
|
||||
// TODO: add better exception that can detail the two conflicting artifacts
|
||||
ArtifactResolutionException are = new ArtifactResolutionException( "Cannot resolve artifact version conflict between " + previous.getArtifact().getVersion()
|
||||
+ " and " + node.getArtifact().getVersion(), previous.getArtifact() );
|
||||
ArtifactResolutionException are =
|
||||
new ArtifactResolutionException( "Cannot resolve artifact version conflict between "
|
||||
+ previous.getArtifact().getVersion() + " and " + node.getArtifact().getVersion(),
|
||||
previous.getArtifact() );
|
||||
result.addVersionRangeViolation( are );
|
||||
}
|
||||
|
||||
if ( ( resolved != previous ) && ( resolved != node ) )
|
||||
{
|
||||
// TODO: add better exception
|
||||
result.addVersionRangeViolation( new ArtifactResolutionException( "Conflict resolver returned unknown resolution node: ", resolved.getArtifact() ) );
|
||||
result.addVersionRangeViolation( new ArtifactResolutionException(
|
||||
"Conflict resolver returned unknown resolution node: ",
|
||||
resolved.getArtifact() ) );
|
||||
}
|
||||
|
||||
// TODO: should this be part of mediation?
|
||||
|
@ -513,8 +511,9 @@ public class DefaultLegacyArtifactCollector
|
|||
{
|
||||
throw new OverConstrainedVersionException(
|
||||
"No versions are present in the repository for the artifact with a range "
|
||||
+ versionRange, artifact,
|
||||
childRemoteRepositories );
|
||||
+ versionRange,
|
||||
artifact,
|
||||
childRemoteRepositories );
|
||||
}
|
||||
|
||||
throw new OverConstrainedVersionException( "Couldn't find a version in "
|
||||
|
@ -543,7 +542,7 @@ public class DefaultLegacyArtifactCollector
|
|||
if ( parentArtifact != null && parentArtifact.getDependencyFilter() != null
|
||||
&& !parentArtifact.getDependencyFilter().include( artifact ) )
|
||||
{
|
||||
// MNG-3769: the [probably relocated] artifact is excluded.
|
||||
// MNG-3769: the [probably relocated] artifact is excluded.
|
||||
// We could process exclusions on relocated artifact details in the
|
||||
// MavenMetadataSource.createArtifacts(..) step, BUT that would
|
||||
// require resolving the POM from the repository very early on in
|
||||
|
@ -601,7 +600,8 @@ public class DefaultLegacyArtifactCollector
|
|||
}
|
||||
}
|
||||
|
||||
private void manageArtifact( ResolutionNode node, ManagedVersionMap managedVersions, List<ResolutionListener> listeners )
|
||||
private void manageArtifact( ResolutionNode node, ManagedVersionMap managedVersions,
|
||||
List<ResolutionListener> listeners )
|
||||
{
|
||||
Artifact artifact = (Artifact) managedVersions.get( node.getKey() );
|
||||
|
||||
|
@ -649,7 +649,8 @@ public class DefaultLegacyArtifactCollector
|
|||
|
||||
/* farthest is runtime and nearest has lower priority, change to runtime */
|
||||
if ( Artifact.SCOPE_RUNTIME.equals( farthestArtifact.getScope() )
|
||||
&& ( Artifact.SCOPE_TEST.equals( nearestArtifact.getScope() ) || Artifact.SCOPE_PROVIDED.equals( nearestArtifact.getScope() ) ) )
|
||||
&& ( Artifact.SCOPE_TEST.equals( nearestArtifact.getScope() )
|
||||
|| Artifact.SCOPE_PROVIDED.equals( nearestArtifact.getScope() ) ) )
|
||||
{
|
||||
updateScope = true;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Set;
|
|||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.RepositoryRequest;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
|
||||
import org.apache.maven.artifact.resolver.ResolutionListener;
|
||||
|
@ -44,24 +43,15 @@ import org.apache.maven.repository.legacy.resolver.conflict.ConflictResolver;
|
|||
public interface LegacyArtifactCollector
|
||||
{
|
||||
|
||||
ArtifactResolutionResult collect( Set<Artifact> artifacts,
|
||||
Artifact originatingArtifact,
|
||||
Map managedVersions,
|
||||
ArtifactResolutionRequest repositoryRequest,
|
||||
ArtifactMetadataSource source,
|
||||
ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions,
|
||||
ArtifactResolutionRequest repositoryRequest, ArtifactMetadataSource source,
|
||||
ArtifactFilter filter, List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers );
|
||||
|
||||
ArtifactResolutionResult collect( Set<Artifact> artifacts,
|
||||
Artifact originatingArtifact,
|
||||
Map managedVersions,
|
||||
ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source,
|
||||
ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners,
|
||||
List<ConflictResolver> conflictResolvers );
|
||||
ArtifactResolutionResult collect( Set<Artifact> artifacts, Artifact originatingArtifact, Map managedVersions,
|
||||
ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter,
|
||||
List<ResolutionListener> listeners, List<ConflictResolver> conflictResolvers );
|
||||
|
||||
// used by maven-dependency-tree and maven-dependency-plugin
|
||||
@Deprecated
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.maven.artifact.resolver.ResolutionNode;
|
|||
*/
|
||||
public interface ConflictResolver
|
||||
{
|
||||
static String ROLE = ConflictResolver.class.getName();
|
||||
String ROLE = ConflictResolver.class.getName();
|
||||
|
||||
/**
|
||||
* Determines which of the specified versions of an artifact to use when there are conflicting declarations.
|
||||
|
@ -41,6 +41,5 @@ public interface ConflictResolver
|
|||
* this conflict cannot be resolved
|
||||
* @since 3.0
|
||||
*/
|
||||
ResolutionNode resolveConflict( ResolutionNode node1,
|
||||
ResolutionNode node2 );
|
||||
ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 );
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package org.apache.maven.repository.legacy.resolver.conflict;
|
||||
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
@ -21,6 +19,8 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
/**
|
||||
* The default conflict resolver that delegates to the nearest strategy.
|
||||
*
|
||||
|
@ -30,7 +30,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @deprecated As of 3.0, use a specific implementation instead, e.g. {@link NearestConflictResolver}
|
||||
*/
|
||||
@Deprecated
|
||||
@Component(role=ConflictResolver.class)
|
||||
@Component( role = ConflictResolver.class )
|
||||
public class DefaultConflictResolver
|
||||
extends NearestConflictResolver
|
||||
{
|
||||
|
|
|
@ -36,17 +36,16 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
|
|||
* @todo you don't need the container in here with the active maps (jvz).
|
||||
* @since 3.0
|
||||
*/
|
||||
@Component(role=ConflictResolverFactory.class)
|
||||
@Component( role = ConflictResolverFactory.class )
|
||||
public class DefaultConflictResolverFactory
|
||||
implements ConflictResolverFactory,
|
||||
Contextualizable
|
||||
implements ConflictResolverFactory, Contextualizable
|
||||
{
|
||||
// fields -----------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The plexus container used to obtain instances from.
|
||||
*/
|
||||
@Requirement
|
||||
@Requirement
|
||||
private PlexusContainer container;
|
||||
|
||||
// ConflictResolverFactory methods ----------------------------------------
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @version $Id$
|
||||
* @since 3.0
|
||||
*/
|
||||
@Component(role=ConflictResolver.class, hint="farthest")
|
||||
@Component( role = ConflictResolver.class, hint = "farthest" )
|
||||
public class FarthestConflictResolver
|
||||
implements ConflictResolver
|
||||
{
|
||||
|
@ -41,8 +41,7 @@ public class FarthestConflictResolver
|
|||
* org.apache.maven.artifact.resolver.ResolutionNode)
|
||||
*/
|
||||
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1,
|
||||
ResolutionNode node2 )
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
|
||||
{
|
||||
return node1.getDepth() >= node2.getDepth() ? node1 : node2;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @version $Id$
|
||||
* @since 3.0
|
||||
*/
|
||||
@Component(role=ConflictResolver.class, hint="nearest")
|
||||
@Component( role = ConflictResolver.class, hint = "nearest" )
|
||||
public class NearestConflictResolver
|
||||
implements ConflictResolver
|
||||
{
|
||||
|
@ -42,8 +42,7 @@ public class NearestConflictResolver
|
|||
* org.apache.maven.artifact.resolver.ResolutionNode)
|
||||
*/
|
||||
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1,
|
||||
ResolutionNode node2 )
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
|
||||
{
|
||||
return node1.getDepth() <= node2.getDepth() ? node1 : node2;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @see ArtifactVersion#compareTo(Object)
|
||||
* @since 3.0
|
||||
*/
|
||||
@Component(role=ConflictResolver.class, hint="newest")
|
||||
@Component( role = ConflictResolver.class, hint = "newest" )
|
||||
public class NewestConflictResolver
|
||||
implements ConflictResolver
|
||||
{
|
||||
|
@ -44,8 +44,7 @@ public class NewestConflictResolver
|
|||
* org.apache.maven.artifact.resolver.ResolutionNode)
|
||||
*/
|
||||
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1,
|
||||
ResolutionNode node2 )
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @see ArtifactVersion#compareTo(Object)
|
||||
* @since 3.0
|
||||
*/
|
||||
@Component(role=ConflictResolver.class, hint="oldest")
|
||||
@Component( role = ConflictResolver.class, hint = "oldest" )
|
||||
public class OldestConflictResolver
|
||||
implements ConflictResolver
|
||||
{
|
||||
|
@ -44,8 +44,7 @@ public class OldestConflictResolver
|
|||
* org.apache.maven.artifact.resolver.ResolutionNode)
|
||||
*/
|
||||
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1,
|
||||
ResolutionNode node2 )
|
||||
public ResolutionNode resolveConflict( ResolutionNode node1, ResolutionNode node2 )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ public interface ArtifactTransformationManager
|
|||
|
||||
/**
|
||||
* Take in a artifact and return the transformed artifact for locating in the remote repository. If no
|
||||
* transformation has occured the original artifact is returned.
|
||||
* transformation has occurred the original artifact is returned.
|
||||
*
|
||||
* @param artifact Artifact to be transformed.
|
||||
* @param request the repositories to check
|
||||
|
@ -47,18 +47,19 @@ public interface ArtifactTransformationManager
|
|||
|
||||
/**
|
||||
* Take in a artifact and return the transformed artifact for locating in the remote repository. If no
|
||||
* transformation has occured the original artifact is returned.
|
||||
* transformation has occurred the original artifact is returned.
|
||||
*
|
||||
* @param artifact Artifact to be transformed.
|
||||
* @param remoteRepositories the repositories to check
|
||||
* @param localRepository the local repository
|
||||
*/
|
||||
void transformForResolve( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
|
||||
void transformForResolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException;
|
||||
|
||||
/**
|
||||
* Take in a artifact and return the transformed artifact for locating in the local repository. If no
|
||||
* transformation has occured the original artifact is returned.
|
||||
* transformation has occurred the original artifact is returned.
|
||||
*
|
||||
* @param artifact Artifact to be transformed.
|
||||
* @param localRepository the local repository it will be stored in
|
||||
|
@ -67,14 +68,15 @@ public interface ArtifactTransformationManager
|
|||
throws ArtifactInstallationException;
|
||||
|
||||
/**
|
||||
* Take in a artifact and return the transformed artifact for distributing toa remote repository. If no
|
||||
* transformation has occured the original artifact is returned.
|
||||
* Take in a artifact and return the transformed artifact for distributing to a remote repository. If no
|
||||
* transformation has occurred the original artifact is returned.
|
||||
*
|
||||
* @param artifact Artifact to be transformed.
|
||||
* @param remoteRepository the repository to deploy to
|
||||
* @param localRepository the local repository the metadata is stored in
|
||||
*/
|
||||
void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository, ArtifactRepository localRepository )
|
||||
void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException;
|
||||
|
||||
List getArtifactTransformations();
|
||||
|
|
|
@ -34,11 +34,11 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role=ArtifactTransformationManager.class)
|
||||
@Component( role = ArtifactTransformationManager.class )
|
||||
public class DefaultArtifactTransformationManager
|
||||
implements ArtifactTransformationManager
|
||||
{
|
||||
@Requirement(role=ArtifactTransformation.class, hints={"release", "latest", "snapshot"})
|
||||
@Requirement( role = ArtifactTransformation.class, hints = { "release", "latest", "snapshot" } )
|
||||
private List<ArtifactTransformation> artifactTransformations;
|
||||
|
||||
public void transformForResolve( Artifact artifact, RepositoryRequest request )
|
||||
|
@ -50,8 +50,7 @@ public class DefaultArtifactTransformationManager
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForResolve( Artifact artifact,
|
||||
List<ArtifactRepository> remoteRepositories,
|
||||
public void transformForResolve( Artifact artifact, List<ArtifactRepository> remoteRepositories,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
|
@ -61,8 +60,7 @@ public class DefaultArtifactTransformationManager
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForInstall( Artifact artifact,
|
||||
ArtifactRepository localRepository )
|
||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||
throws ArtifactInstallationException
|
||||
{
|
||||
for ( ArtifactTransformation transform : artifactTransformations )
|
||||
|
@ -71,8 +69,7 @@ public class DefaultArtifactTransformationManager
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForDeployment( Artifact artifact,
|
||||
ArtifactRepository remoteRepository,
|
||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
|||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||
import org.codehaus.plexus.component.annotations.Component;
|
||||
|
||||
@Component(role=ArtifactTransformation.class, hint="latest")
|
||||
@Component( role = ArtifactTransformation.class, hint = "latest" )
|
||||
public class LatestArtifactTransformation
|
||||
extends AbstractVersionTransformation
|
||||
{
|
||||
|
@ -56,21 +56,18 @@ public class LatestArtifactTransformation
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForInstall( Artifact artifact,
|
||||
ArtifactRepository localRepository )
|
||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||
{
|
||||
// metadata is added via addPluginArtifactMetadata
|
||||
}
|
||||
|
||||
public void transformForDeployment( Artifact artifact,
|
||||
ArtifactRepository remoteRepository,
|
||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository )
|
||||
{
|
||||
// metadata is added via addPluginArtifactMetadata
|
||||
}
|
||||
|
||||
protected String constructVersion( Versioning versioning,
|
||||
String baseVersion )
|
||||
protected String constructVersion( Versioning versioning, String baseVersion )
|
||||
{
|
||||
return versioning.getLatest();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role=ArtifactTransformation.class, hint="release")
|
||||
@Component( role = ArtifactTransformation.class, hint = "release" )
|
||||
public class ReleaseArtifactTransformation
|
||||
extends AbstractVersionTransformation
|
||||
{
|
||||
|
@ -65,16 +65,14 @@ public class ReleaseArtifactTransformation
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForInstall( Artifact artifact,
|
||||
ArtifactRepository localRepository )
|
||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||
{
|
||||
ArtifactMetadata metadata = createMetadata( artifact );
|
||||
|
||||
artifact.addMetadata( metadata );
|
||||
}
|
||||
|
||||
public void transformForDeployment( Artifact artifact,
|
||||
ArtifactRepository remoteRepository,
|
||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository )
|
||||
{
|
||||
ArtifactMetadata metadata = createMetadata( artifact );
|
||||
|
@ -96,8 +94,7 @@ public class ReleaseArtifactTransformation
|
|||
return new ArtifactRepositoryMetadata( artifact, versioning );
|
||||
}
|
||||
|
||||
protected String constructVersion( Versioning versioning,
|
||||
String baseVersion )
|
||||
protected String constructVersion( Versioning versioning, String baseVersion )
|
||||
{
|
||||
return versioning.getRelease();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ import org.codehaus.plexus.util.StringUtils;
|
|||
* @author <a href="mailto:mmaczka@interia.pl">Michal Maczka</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role=ArtifactTransformation.class, hint="snapshot")
|
||||
@Component( role = ArtifactTransformation.class, hint = "snapshot" )
|
||||
public class SnapshotTransformation
|
||||
extends AbstractVersionTransformation
|
||||
{
|
||||
|
@ -71,8 +71,7 @@ public class SnapshotTransformation
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForInstall( Artifact artifact,
|
||||
ArtifactRepository localRepository )
|
||||
public void transformForInstall( Artifact artifact, ArtifactRepository localRepository )
|
||||
{
|
||||
if ( artifact.isSnapshot() )
|
||||
{
|
||||
|
@ -84,8 +83,7 @@ public class SnapshotTransformation
|
|||
}
|
||||
}
|
||||
|
||||
public void transformForDeployment( Artifact artifact,
|
||||
ArtifactRepository remoteRepository,
|
||||
public void transformForDeployment( Artifact artifact, ArtifactRepository remoteRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException
|
||||
{
|
||||
|
@ -126,8 +124,7 @@ public class SnapshotTransformation
|
|||
return deploymentTimestamp;
|
||||
}
|
||||
|
||||
protected String constructVersion( Versioning versioning,
|
||||
String baseVersion )
|
||||
protected String constructVersion( Versioning versioning, String baseVersion )
|
||||
{
|
||||
String version = null;
|
||||
Snapshot snapshot = versioning.getSnapshot();
|
||||
|
@ -146,8 +143,7 @@ public class SnapshotTransformation
|
|||
return version;
|
||||
}
|
||||
|
||||
private int resolveLatestSnapshotBuildNumber( Artifact artifact,
|
||||
ArtifactRepository localRepository,
|
||||
private int resolveLatestSnapshotBuildNumber( Artifact artifact, ArtifactRepository localRepository,
|
||||
ArtifactRepository remoteRepository )
|
||||
throws RepositoryMetadataResolutionException
|
||||
{
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
|
@ -7,15 +26,15 @@ import org.apache.maven.artifact.ArtifactScopeEnum;
|
|||
|
||||
/**
|
||||
* Artifact Metadata that is resolved independent of Artifact itself.
|
||||
*
|
||||
*
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
public class ArtifactMetadata
|
||||
{
|
||||
/**
|
||||
* standard glorified artifact coordinates
|
||||
*/
|
||||
/**
|
||||
* standard glorified artifact coordinates
|
||||
*/
|
||||
protected String groupId;
|
||||
protected String artifactId;
|
||||
protected String version;
|
||||
|
@ -23,12 +42,12 @@ public class ArtifactMetadata
|
|||
protected ArtifactScopeEnum artifactScope;
|
||||
protected String classifier;
|
||||
|
||||
/**
|
||||
/**
|
||||
* explanation: why this MD was chosen over it's siblings
|
||||
* in the resulting structure (classpath for now)
|
||||
* in the resulting structure (classpath for now)
|
||||
*/
|
||||
protected String why;
|
||||
|
||||
|
||||
/** dependencies of the artifact behind this metadata */
|
||||
protected Collection<ArtifactMetadata> dependencies;
|
||||
|
||||
|
@ -37,7 +56,7 @@ public class ArtifactMetadata
|
|||
|
||||
/** is metadata found anywhere */
|
||||
protected boolean resolved = false;
|
||||
|
||||
|
||||
/** does the actual artifact for this metadata exists */
|
||||
protected boolean artifactExists = false;
|
||||
/** artifact URI */
|
||||
|
@ -45,93 +64,69 @@ public class ArtifactMetadata
|
|||
|
||||
/** error message */
|
||||
private String error;
|
||||
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public ArtifactMetadata( String name )
|
||||
{
|
||||
if( name == null )
|
||||
return;
|
||||
int ind1 = name.indexOf(':');
|
||||
int ind2 = name.lastIndexOf(':');
|
||||
|
||||
if( ind1 == -1 || ind2 == -1 )
|
||||
return;
|
||||
|
||||
this.groupId = name.substring(0, ind1);
|
||||
if( ind1 == ind2 )
|
||||
{
|
||||
this.artifactId = name.substring(ind1+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.artifactId = name.substring( ind1+1, ind2 );
|
||||
this.version = name.substring( ind2+1 );
|
||||
}
|
||||
if ( name == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
int ind1 = name.indexOf( ':' );
|
||||
int ind2 = name.lastIndexOf( ':' );
|
||||
|
||||
if ( ind1 == -1 || ind2 == -1 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.groupId = name.substring( 0, ind1 );
|
||||
if ( ind1 == ind2 )
|
||||
{
|
||||
this.artifactId = name.substring( ind1 + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.artifactId = name.substring( ind1 + 1, ind2 );
|
||||
this.version = name.substring( ind2 + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId,
|
||||
String name,
|
||||
String version )
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId, String name, String version )
|
||||
{
|
||||
this( groupId, name, version, null );
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId,
|
||||
String name,
|
||||
String version,
|
||||
String type )
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type )
|
||||
{
|
||||
this( groupId, name, version, type, null );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId,
|
||||
String name,
|
||||
String version,
|
||||
String type,
|
||||
ArtifactScopeEnum artifactScope )
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type, ArtifactScopeEnum artifactScope )
|
||||
{
|
||||
this( groupId, name, version, type, artifactScope, null );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId,
|
||||
String name,
|
||||
String version,
|
||||
String type,
|
||||
ArtifactScopeEnum artifactScope,
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type, ArtifactScopeEnum artifactScope,
|
||||
String classifier )
|
||||
{
|
||||
this( groupId, name, version, type, artifactScope, classifier, null );
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId,
|
||||
String name,
|
||||
String version,
|
||||
String type,
|
||||
ArtifactScopeEnum artifactScope,
|
||||
String classifier
|
||||
, String artifactUri
|
||||
)
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type, ArtifactScopeEnum artifactScope,
|
||||
String classifier, String artifactUri )
|
||||
{
|
||||
this( groupId, name, version, type, artifactScope, classifier, artifactUri, null, true, null );
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId
|
||||
, String name
|
||||
, String version
|
||||
, String type
|
||||
, ArtifactScopeEnum artifactScope
|
||||
, String classifier
|
||||
, String artifactUri
|
||||
, String why
|
||||
, boolean resolved
|
||||
, String error
|
||||
)
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type, ArtifactScopeEnum artifactScope,
|
||||
String classifier, String artifactUri, String why, boolean resolved, String error )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
this.artifactId = name;
|
||||
|
@ -145,29 +140,12 @@ public class ArtifactMetadata
|
|||
this.error = error;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public ArtifactMetadata( String groupId
|
||||
, String name
|
||||
, String version
|
||||
, String type
|
||||
, String scopeString
|
||||
, String classifier
|
||||
, String artifactUri
|
||||
, String why
|
||||
, boolean resolved
|
||||
, String error
|
||||
)
|
||||
public ArtifactMetadata( String groupId, String name, String version, String type, String scopeString,
|
||||
String classifier, String artifactUri, String why, boolean resolved, String error )
|
||||
{
|
||||
this( groupId
|
||||
, name
|
||||
, version
|
||||
, type
|
||||
, scopeString == null ? ArtifactScopeEnum.DEFAULT_SCOPE : ArtifactScopeEnum.valueOf(scopeString)
|
||||
, classifier
|
||||
, artifactUri
|
||||
, why
|
||||
, resolved
|
||||
, error
|
||||
);
|
||||
this( groupId, name, version, type,
|
||||
scopeString == null ? ArtifactScopeEnum.DEFAULT_SCOPE : ArtifactScopeEnum.valueOf( scopeString ),
|
||||
classifier, artifactUri, why, resolved, error );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
@ -265,10 +243,7 @@ public class ArtifactMetadata
|
|||
|
||||
public void setScope( String scope )
|
||||
{
|
||||
this.artifactScope = scope == null
|
||||
? ArtifactScopeEnum.DEFAULT_SCOPE
|
||||
: ArtifactScopeEnum.valueOf( scope )
|
||||
;
|
||||
this.artifactScope = scope == null ? ArtifactScopeEnum.DEFAULT_SCOPE : ArtifactScopeEnum.valueOf( scope );
|
||||
}
|
||||
|
||||
public String getClassifier()
|
||||
|
@ -310,62 +285,62 @@ public class ArtifactMetadata
|
|||
{
|
||||
return artifactScope == null ? ArtifactScopeEnum.DEFAULT_SCOPE : artifactScope;
|
||||
}
|
||||
|
||||
|
||||
public boolean isArtifactExists()
|
||||
{
|
||||
return artifactExists;
|
||||
}
|
||||
{
|
||||
return artifactExists;
|
||||
}
|
||||
|
||||
public void setArtifactExists(boolean artifactExists)
|
||||
{
|
||||
this.artifactExists = artifactExists;
|
||||
}
|
||||
|
||||
|
||||
public void setArtifactExists(boolean artifactExists)
|
||||
{
|
||||
this.artifactExists = artifactExists;
|
||||
}
|
||||
|
||||
|
||||
public Collection<ArtifactMetadata> getDependencies()
|
||||
{
|
||||
return dependencies;
|
||||
}
|
||||
{
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
public void setDependencies(Collection<ArtifactMetadata> dependencies)
|
||||
{
|
||||
this.dependencies = dependencies;
|
||||
}
|
||||
public void setDependencies(Collection<ArtifactMetadata> dependencies)
|
||||
{
|
||||
this.dependencies = dependencies;
|
||||
}
|
||||
|
||||
public String getArtifactUri()
|
||||
{
|
||||
return artifactUri;
|
||||
}
|
||||
public String getArtifactUri()
|
||||
{
|
||||
return artifactUri;
|
||||
}
|
||||
|
||||
public void setArtifactUri(String artifactUri)
|
||||
{
|
||||
this.artifactUri = artifactUri;
|
||||
}
|
||||
|
||||
public void setArtifactUri(String artifactUri)
|
||||
{
|
||||
this.artifactUri = artifactUri;
|
||||
}
|
||||
|
||||
|
||||
public String getWhy()
|
||||
{
|
||||
return why;
|
||||
}
|
||||
public void setWhy(String why)
|
||||
{
|
||||
this.why = why;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public String getError()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
public void setError(String error)
|
||||
{
|
||||
this.error = error;
|
||||
}
|
||||
public boolean isError()
|
||||
{
|
||||
return error == null;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public String getDependencyConflictId()
|
||||
{
|
||||
return why;
|
||||
}
|
||||
public void setWhy(String why)
|
||||
{
|
||||
this.why = why;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public String getError()
|
||||
{
|
||||
return error;
|
||||
}
|
||||
public void setError(String error)
|
||||
{
|
||||
this.error = error;
|
||||
}
|
||||
public boolean isError()
|
||||
{
|
||||
return error == null;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
public String getDependencyConflictId()
|
||||
{
|
||||
return groupId + ":" + artifactId;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.maven.artifact.ArtifactScopeEnum;
|
|||
public class ClasspathContainer
|
||||
implements Iterable<ArtifactMetadata>
|
||||
{
|
||||
private List<ArtifactMetadata> classpath;
|
||||
private List<ArtifactMetadata> classpath;
|
||||
|
||||
private ArtifactScopeEnum scope;
|
||||
|
||||
|
|
|
@ -1,11 +1,29 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.ArtifactScopeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to conver an Md Graph into some form of a classpath
|
||||
*
|
||||
*
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
|
@ -16,15 +34,13 @@ public interface ClasspathTransformation
|
|||
/**
|
||||
* Transform Graph into a Collection of metadata objects that
|
||||
* could serve as a classpath for a particular scope
|
||||
*
|
||||
*
|
||||
* @param dirtyGraph - dependency graph
|
||||
* @param scope - which classpath to extract
|
||||
* @param resolve - whether to resolve artifacts.
|
||||
* @return Collection of metadata objects in the linked subgraph of the graph which
|
||||
* @return Collection of metadata objects in the linked subgraph of the graph which
|
||||
* contains the graph.getEntry() vertice
|
||||
*/
|
||||
ClasspathContainer transform( MetadataGraph dirtyGraph,
|
||||
ArtifactScopeEnum scope,
|
||||
boolean resolve)
|
||||
throws MetadataGraphTransformationException;
|
||||
ClasspathContainer transform( MetadataGraph dirtyGraph, ArtifactScopeEnum scope, boolean resolve )
|
||||
throws MetadataGraphTransformationException;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
@Component(role=ClasspathTransformation.class)
|
||||
@Component( role = ClasspathTransformation.class )
|
||||
public class DefaultClasspathTransformation
|
||||
implements ClasspathTransformation
|
||||
implements ClasspathTransformation
|
||||
{
|
||||
@Requirement
|
||||
GraphConflictResolver conflictResolver;
|
||||
|
@ -136,7 +136,7 @@ implements ClasspathTransformation
|
|||
// }
|
||||
// );
|
||||
|
||||
List<MetadataGraphEdge> exits = graph.getExcidentEdges(node);
|
||||
List<MetadataGraphEdge> exits = graph.getExcidentEdges( node );
|
||||
|
||||
if ( exits != null && exits.size() > 0 )
|
||||
{
|
||||
|
|
|
@ -29,20 +29,20 @@ import org.codehaus.plexus.component.annotations.Configuration;
|
|||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role=GraphConflictResolutionPolicy.class)
|
||||
@Component( role = GraphConflictResolutionPolicy.class )
|
||||
public class DefaultGraphConflictResolutionPolicy
|
||||
implements GraphConflictResolutionPolicy
|
||||
implements GraphConflictResolutionPolicy
|
||||
{
|
||||
/**
|
||||
* artifact, closer to the entry point, is selected
|
||||
*/
|
||||
@Configuration(name="closer-first", value="true")
|
||||
@Configuration( name = "closer-first", value = "true" )
|
||||
private boolean closerFirst = true;
|
||||
|
||||
/**
|
||||
* newer artifact is selected
|
||||
*/
|
||||
@Configuration(name="newer-first", value="true")
|
||||
@Configuration( name = "newer-first", value = "true" )
|
||||
private boolean newerFirst = true;
|
||||
|
||||
public MetadataGraphEdge apply( MetadataGraphEdge e1, MetadataGraphEdge e2 )
|
||||
|
|
|
@ -29,18 +29,18 @@ import org.codehaus.plexus.component.annotations.Requirement;
|
|||
|
||||
/**
|
||||
* Default conflict resolver.Implements closer newer first policy by default, but could be configured via plexus
|
||||
*
|
||||
*
|
||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
@Component(role=GraphConflictResolver.class)
|
||||
@Component( role = GraphConflictResolver.class )
|
||||
public class DefaultGraphConflictResolver
|
||||
implements GraphConflictResolver
|
||||
{
|
||||
/**
|
||||
* artifact, closer to the entry point, is selected
|
||||
*/
|
||||
@Requirement(role=GraphConflictResolutionPolicy.class)
|
||||
@Requirement( role = GraphConflictResolutionPolicy.class )
|
||||
protected GraphConflictResolutionPolicy policy;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
|
@ -49,20 +49,30 @@ public class DefaultGraphConflictResolver
|
|||
throws GraphConflictResolutionException
|
||||
{
|
||||
if ( policy == null )
|
||||
{
|
||||
throw new GraphConflictResolutionException( "no GraphConflictResolutionPolicy injected" );
|
||||
}
|
||||
|
||||
if ( graph == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final MetadataGraphVertex entry = graph.getEntry();
|
||||
if ( entry == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( graph.isEmpty() )
|
||||
{
|
||||
throw new GraphConflictResolutionException( "graph with an entry, but not vertices do not exist" );
|
||||
}
|
||||
|
||||
if ( graph.isEmptyEdges() )
|
||||
{
|
||||
return null; // no edges - nothing to worry about
|
||||
}
|
||||
|
||||
final TreeSet<MetadataGraphVertex> vertices = graph.getVertices();
|
||||
|
||||
|
@ -70,7 +80,9 @@ public class DefaultGraphConflictResolver
|
|||
{
|
||||
// edge case - single vertex graph
|
||||
if ( vertices.size() == 1 )
|
||||
{
|
||||
return new MetadataGraph( entry );
|
||||
}
|
||||
|
||||
final ArtifactScopeEnum requestedScope = ArtifactScopeEnum.checkScope( scope );
|
||||
|
||||
|
@ -138,7 +150,9 @@ public class DefaultGraphConflictResolver
|
|||
private MetadataGraph findLinkedSubgraph( MetadataGraph g )
|
||||
{
|
||||
if ( g.getVertices().size() == 1 )
|
||||
{
|
||||
return g;
|
||||
}
|
||||
|
||||
List<MetadataGraphVertex> visited = new ArrayList<MetadataGraphVertex>( g.getVertices().size() );
|
||||
visit( g.getEntry(), visited, g );
|
||||
|
@ -149,11 +163,15 @@ public class DefaultGraphConflictResolver
|
|||
for ( MetadataGraphVertex v : g.getVertices() )
|
||||
{
|
||||
if ( !visited.contains( v ) )
|
||||
{
|
||||
dropList.add( v );
|
||||
}
|
||||
}
|
||||
|
||||
if ( dropList.size() < 1 )
|
||||
{
|
||||
return g;
|
||||
}
|
||||
|
||||
// now - drop vertices
|
||||
TreeSet<MetadataGraphVertex> vertices = g.getVertices();
|
||||
|
@ -169,7 +187,9 @@ public class DefaultGraphConflictResolver
|
|||
private void visit( MetadataGraphVertex from, List<MetadataGraphVertex> visited, MetadataGraph graph )
|
||||
{
|
||||
if ( visited.contains( from ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
visited.add( from );
|
||||
|
||||
|
@ -185,16 +205,21 @@ public class DefaultGraphConflictResolver
|
|||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
private MetadataGraphEdge cleanEdges( MetadataGraphVertex v, List<MetadataGraphEdge> edges, ArtifactScopeEnum scope )
|
||||
private MetadataGraphEdge cleanEdges( MetadataGraphVertex v, List<MetadataGraphEdge> edges,
|
||||
ArtifactScopeEnum scope )
|
||||
{
|
||||
if ( edges == null || edges.isEmpty() )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( edges.size() == 1 )
|
||||
{
|
||||
MetadataGraphEdge e = edges.get( 0 );
|
||||
if ( scope.encloses( e.getScope() ) )
|
||||
{
|
||||
return e;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -204,12 +229,18 @@ public class DefaultGraphConflictResolver
|
|||
for ( MetadataGraphEdge e : edges )
|
||||
{
|
||||
if ( !scope.encloses( e.getScope() ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( res == null )
|
||||
{
|
||||
res = e;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = policy.apply( e, res );
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -1,34 +1,52 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
* @version $Id$
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
public class GraphConflictResolutionException
|
||||
extends Exception
|
||||
extends Exception
|
||||
{
|
||||
private static final long serialVersionUID = 2677613140287940255L;
|
||||
private static final long serialVersionUID = 2677613140287940255L;
|
||||
|
||||
public GraphConflictResolutionException()
|
||||
{
|
||||
}
|
||||
public GraphConflictResolutionException()
|
||||
{
|
||||
}
|
||||
|
||||
public GraphConflictResolutionException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
public GraphConflictResolutionException( String message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
public GraphConflictResolutionException(Throwable cause)
|
||||
{
|
||||
super(cause);
|
||||
}
|
||||
public GraphConflictResolutionException( Throwable cause )
|
||||
{
|
||||
super( cause );
|
||||
}
|
||||
|
||||
public GraphConflictResolutionException(String message, Throwable cause)
|
||||
{
|
||||
super(message, cause);
|
||||
}
|
||||
public GraphConflictResolutionException( String message, Throwable cause )
|
||||
{
|
||||
super( message, cause );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,21 +1,36 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* MetadataGraph edge selection policy. Complements
|
||||
* MetadataGraph edge selection policy. Complements
|
||||
* GraphConflictResolver by being injected into it
|
||||
*
|
||||
*
|
||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
public interface GraphConflictResolutionPolicy
|
||||
{
|
||||
static String ROLE = GraphConflictResolutionPolicy.class.getName();
|
||||
String ROLE = GraphConflictResolutionPolicy.class.getName();
|
||||
|
||||
public MetadataGraphEdge apply(
|
||||
MetadataGraphEdge e1
|
||||
, MetadataGraphEdge e2
|
||||
);
|
||||
MetadataGraphEdge apply( MetadataGraphEdge e1, MetadataGraphEdge e2 );
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.apache.maven.repository.metadata;
|
|||
import org.apache.maven.artifact.ArtifactScopeEnum;
|
||||
|
||||
/**
|
||||
* Resolves conflicts in the supplied dependency graph.
|
||||
* Resolves conflicts in the supplied dependency graph.
|
||||
* Different implementations will implement different conflict resolution policies.
|
||||
*
|
||||
* @author <a href="mailto:oleg@codehaus.org">Oleg Gusakov</a>
|
||||
|
@ -30,20 +30,20 @@ import org.apache.maven.artifact.ArtifactScopeEnum;
|
|||
*/
|
||||
public interface GraphConflictResolver
|
||||
{
|
||||
static String ROLE = GraphConflictResolver.class.getName();
|
||||
String ROLE = GraphConflictResolver.class.getName();
|
||||
|
||||
/**
|
||||
* Cleanses the supplied graph by leaving only one directed versioned edge\
|
||||
* between any two nodes, if multiple exists. Uses scope relationships, defined
|
||||
* between any two nodes, if multiple exists. Uses scope relationships, defined
|
||||
* in <code>ArtifactScopeEnum</code>
|
||||
*
|
||||
* @param graph the "dirty" graph to be simplified via conflict resolution
|
||||
* @param scope scope for which the graph should be resolved
|
||||
*
|
||||
*
|
||||
* @return resulting "clean" graph for the specified scope
|
||||
*
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
MetadataGraph resolveConflicts( MetadataGraph graph, ArtifactScopeEnum scope )
|
||||
throws GraphConflictResolutionException;
|
||||
throws GraphConflictResolutionException;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.apache.maven.artifact.ArtifactScopeEnum;
|
|||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public class MetadataGraph
|
||||
{
|
||||
public static final int DEFAULT_VERTICES = 32;
|
||||
|
@ -79,7 +78,7 @@ public class MetadataGraph
|
|||
* construct a single vertex
|
||||
*/
|
||||
public MetadataGraph( MetadataGraphVertex entry )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
checkVertex( entry );
|
||||
checkVertices( 1 );
|
||||
|
@ -95,7 +94,7 @@ public class MetadataGraph
|
|||
* construct graph from a "dirty" tree
|
||||
*/
|
||||
public MetadataGraph( MetadataTreeNode tree )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
this( tree, false, false );
|
||||
}
|
||||
|
@ -109,7 +108,7 @@ public class MetadataGraph
|
|||
*
|
||||
*/
|
||||
public MetadataGraph( MetadataTreeNode tree, boolean versionedVertices, boolean scopedVertices )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
if ( tree == null )
|
||||
{
|
||||
|
@ -129,12 +128,8 @@ public class MetadataGraph
|
|||
processTreeNodes( null, tree, 0, 0 );
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
private void processTreeNodes( MetadataGraphVertex parentVertex
|
||||
, MetadataTreeNode node
|
||||
, int depth
|
||||
, int pomOrder
|
||||
)
|
||||
throws MetadataResolutionException
|
||||
private void processTreeNodes( MetadataGraphVertex parentVertex, MetadataTreeNode node, int depth, int pomOrder )
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
if ( node == null )
|
||||
{
|
||||
|
@ -150,7 +145,8 @@ public class MetadataGraph
|
|||
if ( parentVertex != null ) // then create the edge
|
||||
{
|
||||
ArtifactMetadata md = node.getMd();
|
||||
MetadataGraphEdge e = new MetadataGraphEdge( md.version, md.resolved, md.artifactScope, md.artifactUri, depth, pomOrder );
|
||||
MetadataGraphEdge e =
|
||||
new MetadataGraphEdge( md.version, md.resolved, md.artifactScope, md.artifactUri, depth, pomOrder );
|
||||
addEdge( parentVertex, vertex, e );
|
||||
}
|
||||
else
|
||||
|
@ -275,7 +271,7 @@ public class MetadataGraph
|
|||
}
|
||||
//------------------------------------------------------------------------
|
||||
private static void checkVertex( MetadataGraphVertex v )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
if ( v == null )
|
||||
{
|
||||
|
@ -288,7 +284,7 @@ public class MetadataGraph
|
|||
}
|
||||
//------------------------------------------------------------------------
|
||||
private static void checkEdge( MetadataGraphEdge e )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
if ( e == null )
|
||||
{
|
||||
|
@ -318,7 +314,7 @@ public class MetadataGraph
|
|||
}
|
||||
//------------------------------------------------------------------------
|
||||
public MetadataGraph addEdge( MetadataGraphVertex vFrom, MetadataGraphVertex vTo, MetadataGraphEdge e )
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
checkVertex( vFrom );
|
||||
checkVertex( vTo );
|
||||
|
|
|
@ -1,12 +1,30 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.ArtifactScopeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* metadata graph edge - combination of version, scope and depth define
|
||||
* metadata graph edge - combination of version, scope and depth define
|
||||
* an edge in the graph
|
||||
*
|
||||
*
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
|
@ -19,24 +37,19 @@ public class MetadataGraphEdge
|
|||
int pomOrder = -1;
|
||||
boolean resolved = true;
|
||||
String artifactUri;
|
||||
|
||||
|
||||
/**
|
||||
* capturing where this link came from
|
||||
* and where it is linked to.
|
||||
*
|
||||
*
|
||||
* In the first implementation only source used for explanatory function
|
||||
*/
|
||||
MetadataGraphVertex source;
|
||||
MetadataGraphVertex target;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
public MetadataGraphEdge( String version
|
||||
, boolean resolved
|
||||
, ArtifactScopeEnum scope
|
||||
, String artifactUri
|
||||
, int depth
|
||||
, int pomOrder
|
||||
)
|
||||
public MetadataGraphEdge( String version, boolean resolved, ArtifactScopeEnum scope, String artifactUri, int depth,
|
||||
int pomOrder )
|
||||
{
|
||||
super();
|
||||
this.version = version;
|
||||
|
@ -50,16 +63,13 @@ public class MetadataGraphEdge
|
|||
/**
|
||||
* helper for equals
|
||||
*/
|
||||
private static boolean objectsEqual( Object o1,
|
||||
Object o2 )
|
||||
private static boolean objectsEqual( Object o1, Object o2 )
|
||||
{
|
||||
if ( o1 == null && o2 == null )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ( ( o1 == null && o2 != null )
|
||||
|| ( o1 != null && o2 == null )
|
||||
)
|
||||
if ( ( o1 == null && o2 != null ) || ( o1 != null && o2 == null ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -76,14 +86,10 @@ public class MetadataGraphEdge
|
|||
if ( o instanceof MetadataGraphEdge )
|
||||
{
|
||||
MetadataGraphEdge e = (MetadataGraphEdge) o;
|
||||
|
||||
return
|
||||
objectsEqual( version, e.version )
|
||||
&& ArtifactScopeEnum.checkScope(scope).getScope().equals(
|
||||
ArtifactScopeEnum.checkScope(e.scope).getScope()
|
||||
)
|
||||
&& depth == e.depth
|
||||
;
|
||||
|
||||
return objectsEqual( version, e.version )
|
||||
&& ArtifactScopeEnum.checkScope( scope ).getScope().equals( ArtifactScopeEnum.checkScope( e.scope ).getScope() )
|
||||
&& depth == e.depth;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -124,57 +130,60 @@ public class MetadataGraphEdge
|
|||
return resolved;
|
||||
}
|
||||
|
||||
public void setResolved(boolean resolved)
|
||||
{
|
||||
this.resolved = resolved;
|
||||
}
|
||||
public void setResolved( boolean resolved )
|
||||
{
|
||||
this.resolved = resolved;
|
||||
}
|
||||
|
||||
public int getPomOrder()
|
||||
{
|
||||
return pomOrder;
|
||||
}
|
||||
public int getPomOrder()
|
||||
{
|
||||
return pomOrder;
|
||||
}
|
||||
|
||||
public void setPomOrder(int pomOrder)
|
||||
{
|
||||
this.pomOrder = pomOrder;
|
||||
}
|
||||
public void setPomOrder( int pomOrder )
|
||||
{
|
||||
this.pomOrder = pomOrder;
|
||||
}
|
||||
|
||||
public String getArtifactUri()
|
||||
{
|
||||
return artifactUri;
|
||||
}
|
||||
|
||||
public void setArtifactUri( String artifactUri )
|
||||
{
|
||||
this.artifactUri = artifactUri;
|
||||
}
|
||||
|
||||
public MetadataGraphVertex getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource( MetadataGraphVertex source )
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public MetadataGraphVertex getTarget()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget( MetadataGraphVertex target )
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getArtifactUri()
|
||||
{
|
||||
return artifactUri;
|
||||
}
|
||||
public void setArtifactUri(String artifactUri)
|
||||
{
|
||||
this.artifactUri = artifactUri;
|
||||
}
|
||||
|
||||
public MetadataGraphVertex getSource()
|
||||
{
|
||||
return source;
|
||||
}
|
||||
public void setSource(MetadataGraphVertex source)
|
||||
{
|
||||
this.source = source;
|
||||
}
|
||||
public MetadataGraphVertex getTarget()
|
||||
{
|
||||
return target;
|
||||
}
|
||||
public void setTarget(MetadataGraphVertex target)
|
||||
{
|
||||
this.target = target;
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[ "
|
||||
+ "FROM:("+( source==null?"no source":(source.md==null?"no source MD":source.md.toString()) )+") "
|
||||
+ "TO:("+( target==null?"no target":(target.md==null?"no target MD":target.md.toString()) )+") "
|
||||
+"version="+version
|
||||
+", scope="+(scope == null ? "null" : scope.getScope())
|
||||
+", depth="+depth+"]"
|
||||
;
|
||||
}
|
||||
public String toString()
|
||||
{
|
||||
return "[ " + "FROM:("
|
||||
+ ( source == null ? "no source" : ( source.md == null ? "no source MD" : source.md.toString() ) ) + ") "
|
||||
+ "TO:(" + ( target == null ? "no target" : ( target.md == null ? "no target MD" : target.md.toString() ) )
|
||||
+ ") " + "version=" + version + ", scope=" + ( scope == null ? "null" : scope.getScope() ) + ", depth="
|
||||
+ depth + "]";
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
}
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
|
@ -9,23 +28,23 @@ public class MetadataGraphTransformationException
|
|||
{
|
||||
private static final long serialVersionUID = -4029897098314019152L;
|
||||
|
||||
public MetadataGraphTransformationException()
|
||||
{
|
||||
}
|
||||
public MetadataGraphTransformationException()
|
||||
{
|
||||
}
|
||||
|
||||
public MetadataGraphTransformationException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
public MetadataGraphTransformationException( String message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
public MetadataGraphTransformationException(Throwable cause)
|
||||
{
|
||||
super(cause);
|
||||
}
|
||||
public MetadataGraphTransformationException( Throwable cause )
|
||||
{
|
||||
super( cause );
|
||||
}
|
||||
|
||||
public MetadataGraphTransformationException(String message, Throwable cause)
|
||||
{
|
||||
super(message, cause);
|
||||
}
|
||||
public MetadataGraphTransformationException( String message, Throwable cause )
|
||||
{
|
||||
super( message, cause );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,32 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Jason van Zyl
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MetadataResolution
|
||||
{
|
||||
|
@ -22,33 +41,31 @@ public class MetadataResolution
|
|||
this.artifactMetadata = artifactMetadata;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public MetadataResolution( ArtifactMetadata artifactMetadata,
|
||||
Collection<ArtifactRepository> metadataRepositories )
|
||||
public MetadataResolution( ArtifactMetadata artifactMetadata, Collection<ArtifactRepository> metadataRepositories )
|
||||
{
|
||||
this( artifactMetadata );
|
||||
this( artifactMetadata );
|
||||
this.metadataRepositories = metadataRepositories;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public Collection<ArtifactRepository> getMetadataRepositories()
|
||||
{
|
||||
return metadataRepositories;
|
||||
}
|
||||
public Collection<ArtifactRepository> getMetadataRepositories()
|
||||
{
|
||||
return metadataRepositories;
|
||||
}
|
||||
|
||||
public void setMetadataRepositories(
|
||||
Collection<ArtifactRepository> metadataRepositories)
|
||||
{
|
||||
this.metadataRepositories = metadataRepositories;
|
||||
}
|
||||
public void setMetadataRepositories( Collection<ArtifactRepository> metadataRepositories )
|
||||
{
|
||||
this.metadataRepositories = metadataRepositories;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
public ArtifactMetadata getArtifactMetadata()
|
||||
{
|
||||
return artifactMetadata;
|
||||
}
|
||||
public ArtifactMetadata getArtifactMetadata()
|
||||
{
|
||||
return artifactMetadata;
|
||||
}
|
||||
|
||||
public void setArtifactMetadata(ArtifactMetadata artifactMetadata)
|
||||
{
|
||||
this.artifactMetadata = artifactMetadata;
|
||||
}
|
||||
public void setArtifactMetadata(ArtifactMetadata artifactMetadata)
|
||||
{
|
||||
this.artifactMetadata = artifactMetadata;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
public class MetadataResolutionException
|
||||
extends Exception
|
||||
{
|
||||
|
@ -21,8 +40,7 @@ public class MetadataResolutionException
|
|||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public MetadataResolutionException( String message,
|
||||
Throwable cause )
|
||||
public MetadataResolutionException( String message, Throwable cause )
|
||||
{
|
||||
super( message, cause );
|
||||
// TODO Auto-generated constructor stub
|
||||
|
|
|
@ -1,10 +1,28 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
|
||||
|
||||
/** @author Oleg Gusakov */
|
||||
public class MetadataResolutionRequest
|
||||
{
|
||||
|
@ -18,8 +36,7 @@ public class MetadataResolutionRequest
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
public MetadataResolutionRequest( ArtifactMetadata query,
|
||||
ArtifactRepository localRepository,
|
||||
public MetadataResolutionRequest( ArtifactMetadata query, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories )
|
||||
{
|
||||
this.query = query;
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
public enum MetadataResolutionRequestTypeEnum
|
||||
{
|
||||
tree( 1 )
|
||||
|
|
|
@ -61,20 +61,20 @@ public class MetadataResolutionResult
|
|||
}
|
||||
|
||||
public void initTreeProcessing( PlexusContainer plexus )
|
||||
throws ComponentLookupException
|
||||
throws ComponentLookupException
|
||||
{
|
||||
classpathTransformation = (ClasspathTransformation) plexus.lookup( ClasspathTransformation.class );
|
||||
conflictResolver = (GraphConflictResolver) plexus.lookup( GraphConflictResolver.class );
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
public MetadataGraph getGraph()
|
||||
throws MetadataResolutionException
|
||||
throws MetadataResolutionException
|
||||
{
|
||||
return treeRoot == null ? null : new MetadataGraph( treeRoot );
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
public MetadataGraph getGraph( ArtifactScopeEnum scope )
|
||||
throws MetadataResolutionException, GraphConflictResolutionException
|
||||
throws MetadataResolutionException, GraphConflictResolutionException
|
||||
{
|
||||
if ( treeRoot == null )
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ public class MetadataResolutionResult
|
|||
}
|
||||
//----------------------------------------------------------------------------
|
||||
public MetadataGraph getGraph( MetadataResolutionRequestTypeEnum requestType )
|
||||
throws MetadataResolutionException, GraphConflictResolutionException
|
||||
throws MetadataResolutionException, GraphConflictResolutionException
|
||||
{
|
||||
if ( requestType == null )
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ public class MetadataResolutionResult
|
|||
}
|
||||
//----------------------------------------------------------------------------
|
||||
public ClasspathContainer getClasspath( ArtifactScopeEnum scope )
|
||||
throws MetadataGraphTransformationException, MetadataResolutionException
|
||||
throws MetadataGraphTransformationException, MetadataResolutionException
|
||||
{
|
||||
if ( classpathTransformation == null )
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ public class MetadataResolutionResult
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
public MetadataTreeNode getClasspathTree( ArtifactScopeEnum scope )
|
||||
throws MetadataGraphTransformationException, MetadataResolutionException
|
||||
throws MetadataGraphTransformationException, MetadataResolutionException
|
||||
{
|
||||
ClasspathContainer cpc = getClasspath( scope );
|
||||
if ( cpc == null )
|
||||
|
|
|
@ -41,15 +41,12 @@ public class MetadataRetrievalException
|
|||
this( null, cause, null );
|
||||
}
|
||||
|
||||
public MetadataRetrievalException( String message,
|
||||
Throwable cause )
|
||||
public MetadataRetrievalException( String message, Throwable cause )
|
||||
{
|
||||
this( message, cause, null );
|
||||
}
|
||||
|
||||
public MetadataRetrievalException( String message,
|
||||
Throwable cause,
|
||||
ArtifactMetadata artifact )
|
||||
public MetadataRetrievalException( String message, Throwable cause, ArtifactMetadata artifact )
|
||||
{
|
||||
super( message, cause );
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public interface MetadataSource
|
|||
{
|
||||
String ROLE = MetadataSource.class.getName();
|
||||
|
||||
MetadataResolution retrieve( ArtifactMetadata artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
|
||||
MetadataResolution retrieve( ArtifactMetadata artifact, ArtifactRepository localRepository,
|
||||
List<ArtifactRepository> remoteRepositories )
|
||||
throws MetadataRetrievalException;
|
||||
}
|
|
@ -1,14 +1,33 @@
|
|||
package org.apache.maven.repository.metadata;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.ArtifactScopeEnum;
|
||||
|
||||
/**
|
||||
* metadata [dirty] Tree
|
||||
*
|
||||
*
|
||||
* @author <a href="oleg@codehaus.org">Oleg Gusakov</a>
|
||||
*
|
||||
*/
|
||||
|
||||
public class MetadataTreeNode
|
||||
{
|
||||
ArtifactMetadata md; // this node
|
||||
|
@ -21,44 +40,38 @@ public class MetadataTreeNode
|
|||
MetadataTreeNode[] children; // of cause
|
||||
|
||||
public int getNChildren()
|
||||
{
|
||||
return nChildren;
|
||||
}
|
||||
{
|
||||
return nChildren;
|
||||
}
|
||||
|
||||
public void setNChildren(int children)
|
||||
{
|
||||
nChildren = children;
|
||||
}
|
||||
public void setNChildren( int children )
|
||||
{
|
||||
nChildren = children;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------
|
||||
public MetadataTreeNode()
|
||||
{
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
public MetadataTreeNode( ArtifactMetadata md,
|
||||
MetadataTreeNode parent,
|
||||
boolean resolved,
|
||||
ArtifactScopeEnum scope )
|
||||
public MetadataTreeNode( ArtifactMetadata md, MetadataTreeNode parent, boolean resolved, ArtifactScopeEnum scope )
|
||||
{
|
||||
if ( md != null )
|
||||
{
|
||||
md.setArtifactScope( ArtifactScopeEnum.checkScope(scope) );
|
||||
md.setResolved(resolved);
|
||||
md.setArtifactScope( ArtifactScopeEnum.checkScope( scope ) );
|
||||
md.setResolved( resolved );
|
||||
}
|
||||
|
||||
this.md = md;
|
||||
this.parent = parent;
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
public MetadataTreeNode( Artifact af,
|
||||
MetadataTreeNode parent,
|
||||
boolean resolved,
|
||||
ArtifactScopeEnum scope
|
||||
)
|
||||
public MetadataTreeNode( Artifact af, MetadataTreeNode parent, boolean resolved, ArtifactScopeEnum scope )
|
||||
{
|
||||
this( new ArtifactMetadata( af ), parent, resolved, scope );
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
public void addChild( int index, MetadataTreeNode kid )
|
||||
{
|
||||
if ( kid == null )
|
||||
|
@ -66,17 +79,21 @@ public class MetadataTreeNode
|
|||
return;
|
||||
}
|
||||
|
||||
if( children == null )
|
||||
children = new MetadataTreeNode[nChildren];
|
||||
|
||||
if ( children == null )
|
||||
{
|
||||
children = new MetadataTreeNode[nChildren];
|
||||
}
|
||||
|
||||
children[index % nChildren] = kid;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return md == null ? "no metadata" : md.toString();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
public String graphHash()
|
||||
throws MetadataResolutionException
|
||||
|
@ -84,8 +101,7 @@ public class MetadataTreeNode
|
|||
if ( md == null )
|
||||
{
|
||||
throw new MetadataResolutionException( "treenode without metadata, parent: "
|
||||
+ ( parent == null ? "null" : parent.toString() )
|
||||
);
|
||||
+ ( parent == null ? "null" : parent.toString() ) );
|
||||
}
|
||||
|
||||
return md.groupId + ":" + md.artifactId;
|
||||
|
|
|
@ -72,11 +72,13 @@ public class ExpressionDocumenter
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
throw new ExpressionDocumentationException( "Failed to read documentation for expression root: " + EXPRESSION_ROOTS[i], e );
|
||||
throw new ExpressionDocumentationException( "Failed to read documentation for expression root: "
|
||||
+ EXPRESSION_ROOTS[i], e );
|
||||
}
|
||||
catch ( XmlPullParserException e )
|
||||
{
|
||||
throw new ExpressionDocumentationException( "Failed to parse documentation for expression root: " + EXPRESSION_ROOTS[i], e );
|
||||
throw new ExpressionDocumentationException( "Failed to parse documentation for expression root: "
|
||||
+ EXPRESSION_ROOTS[i], e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -110,8 +112,8 @@ public class ExpressionDocumenter
|
|||
* ]]></usage>
|
||||
* </expression>
|
||||
* <expressions>
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
*/
|
||||
private static Map parseExpressionDocumentation( InputStream docStream )
|
||||
throws IOException, XmlPullParserException
|
||||
|
|
|
@ -1,53 +1,58 @@
|
|||
package org.apache.maven;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
|
||||
/**
|
||||
* Allows core extensions to participate in build lifecycle.
|
||||
*
|
||||
* All callback methods (will) follow beforeXXX/afterXXX naming pattern to
|
||||
* indicate at what lifecycle point it is being called.
|
||||
*
|
||||
* Allows core extensions to participate in build lifecycle.
|
||||
*
|
||||
* All callback methods (will) follow beforeXXX/afterXXX naming pattern to
|
||||
* indicate at what lifecycle point it is being called.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractMavenLifecycleParticipant
|
||||
{
|
||||
|
||||
/**
|
||||
* Invoked after all MavenProject instances have been created.
|
||||
*
|
||||
*
|
||||
* This callback is intended to allow extensions to manipulate MavenProjects
|
||||
* before they are sorted and actual build execution starts.
|
||||
*/
|
||||
public void afterProjectsRead( MavenSession session ) throws MavenExecutionException
|
||||
public void afterProjectsRead( MavenSession session )
|
||||
throws MavenExecutionException
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked after MavenSession instance has been created.
|
||||
*
|
||||
* Invoked after MavenSession instance has been created.
|
||||
*
|
||||
* This callback is intended to allow extensions to inject execution properties,
|
||||
* activate profiles and perform similar tasks that affect MavenProject
|
||||
* instance construction.
|
||||
*/
|
||||
// TODO: This is too early for build extensions, so maybe just remove it?
|
||||
public void afterSessionStart( MavenSession session ) throws MavenExecutionException
|
||||
public void afterSessionStart( MavenSession session )
|
||||
throws MavenExecutionException
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
@ -1,5 +1,24 @@
|
|||
package org.apache.maven;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface ArtifactFilterManagerDelegate
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.apache.maven;
|
||||
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
package org.apache.maven;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
|
||||
* agreements. See the NOTICE file distributed with this work for additional information regarding
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
@ -37,7 +41,6 @@ import org.apache.maven.execution.MavenExecutionRequestPopulator;
|
|||
import org.apache.maven.execution.MavenExecutionResult;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.execution.ProjectDependencyGraph;
|
||||
import org.apache.maven.lifecycle.LifecycleExecutor;
|
||||
import org.apache.maven.lifecycle.internal.ExecutionEventCatapult;
|
||||
import org.apache.maven.lifecycle.internal.LifecycleStarter;
|
||||
import org.apache.maven.model.building.ModelProblem;
|
||||
|
@ -64,7 +67,7 @@ import org.codehaus.plexus.util.dag.CycleDetectedException;
|
|||
/**
|
||||
* @author Jason van Zyl
|
||||
*/
|
||||
@Component(role = Maven.class)
|
||||
@Component( role = Maven.class )
|
||||
public class DefaultMaven
|
||||
implements Maven
|
||||
{
|
||||
|
@ -114,17 +117,18 @@ public class DefaultMaven
|
|||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"ThrowableInstanceNeverThrown", "ThrowableResultOfMethodCallIgnored"})
|
||||
@SuppressWarnings( { "ThrowableInstanceNeverThrown", "ThrowableResultOfMethodCallIgnored" } )
|
||||
private MavenExecutionResult doExecute( MavenExecutionRequest request )
|
||||
{
|
||||
//TODO: Need a general way to inject standard properties
|
||||
if ( request.getStartTime() != null )
|
||||
{
|
||||
request.getSystemProperties().put( "${build.timestamp}", new SimpleDateFormat( "yyyyMMdd-hhmm" ).format( request.getStartTime() ) );
|
||||
}
|
||||
|
||||
request.getSystemProperties().put( "${build.timestamp}",
|
||||
new SimpleDateFormat( "yyyyMMdd-hhmm" ).format( request.getStartTime() ) );
|
||||
}
|
||||
|
||||
request.setStartTime( new Date() );
|
||||
|
||||
|
||||
MavenExecutionResult result = new DefaultMavenExecutionResult();
|
||||
|
||||
try
|
||||
|
@ -138,11 +142,11 @@ public class DefaultMaven
|
|||
|
||||
DelegatingLocalArtifactRepository delegatingLocalArtifactRepository =
|
||||
new DelegatingLocalArtifactRepository( request.getLocalRepository() );
|
||||
|
||||
request.setLocalRepository( delegatingLocalArtifactRepository );
|
||||
|
||||
MavenSession session = new MavenSession( container, request, result);
|
||||
|
||||
request.setLocalRepository( delegatingLocalArtifactRepository );
|
||||
|
||||
MavenSession session = new MavenSession( container, request, result );
|
||||
|
||||
try
|
||||
{
|
||||
for ( AbstractMavenLifecycleParticipant listener : getLifecycleParticipants( Collections.<MavenProject> emptyList() ) )
|
||||
|
@ -158,11 +162,11 @@ public class DefaultMaven
|
|||
eventCatapult.fire( ExecutionEvent.Type.ProjectDiscoveryStarted, session, null );
|
||||
|
||||
//TODO: optimize for the single project or no project
|
||||
|
||||
|
||||
List<MavenProject> projects;
|
||||
try
|
||||
{
|
||||
projects = getProjectsForMavenReactor( request );
|
||||
projects = getProjectsForMavenReactor( request );
|
||||
}
|
||||
catch ( ProjectBuildingException e )
|
||||
{
|
||||
|
@ -172,14 +176,14 @@ public class DefaultMaven
|
|||
session.setProjects( projects );
|
||||
|
||||
result.setTopologicallySortedProjects( session.getProjects() );
|
||||
|
||||
|
||||
result.setProject( session.getTopLevelProject() );
|
||||
|
||||
try
|
||||
{
|
||||
Map<String, MavenProject> projectMap;
|
||||
projectMap = getProjectMap( session.getProjects() );
|
||||
|
||||
|
||||
// Desired order of precedence for local artifact repositories
|
||||
//
|
||||
// Reactor
|
||||
|
@ -222,7 +226,7 @@ public class DefaultMaven
|
|||
session.setProjectDependencyGraph( projectDependencyGraph );
|
||||
}
|
||||
catch ( CycleDetectedException e )
|
||||
{
|
||||
{
|
||||
String message = "The projects in the reactor contain a cyclic reference: " + e.getMessage();
|
||||
|
||||
ProjectCycleException error = new ProjectCycleException( message, e );
|
||||
|
@ -257,7 +261,7 @@ public class DefaultMaven
|
|||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"ResultOfMethodCallIgnored"})
|
||||
@SuppressWarnings( { "ResultOfMethodCallIgnored" } )
|
||||
private void validateLocalRepository( MavenExecutionRequest request )
|
||||
throws LocalRepositoryNotAccessibleException
|
||||
{
|
||||
|
@ -330,7 +334,7 @@ public class DefaultMaven
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private List<MavenProject> getProjectsForMavenReactor( MavenExecutionRequest request )
|
||||
throws ProjectBuildingException
|
||||
{
|
||||
|
@ -348,8 +352,8 @@ public class DefaultMaven
|
|||
request.setProjectPresent( false );
|
||||
return projects;
|
||||
}
|
||||
|
||||
List<File> files = Arrays.asList( request.getPom().getAbsoluteFile() );
|
||||
|
||||
List<File> files = Arrays.asList( request.getPom().getAbsoluteFile() );
|
||||
collectProjects( projects, files, request );
|
||||
return projects;
|
||||
}
|
||||
|
@ -401,7 +405,8 @@ public class DefaultMaven
|
|||
{
|
||||
ProjectBuildingRequest projectBuildingRequest = request.getProjectBuildingRequest();
|
||||
|
||||
List<ProjectBuildingResult> results = projectBuilder.build( files, request.isRecursive(), projectBuildingRequest );
|
||||
List<ProjectBuildingResult> results =
|
||||
projectBuilder.build( files, request.isRecursive(), projectBuildingRequest );
|
||||
|
||||
boolean problems = false;
|
||||
|
||||
|
@ -418,7 +423,8 @@ public class DefaultMaven
|
|||
for ( ModelProblem problem : result.getProblems() )
|
||||
{
|
||||
String location = ModelProblemUtils.formatLocation( problem, result.getProjectId() );
|
||||
logger.warn( problem.getMessage() + ( StringUtils.isNotEmpty( location ) ? " @ " + location : "" ) );
|
||||
logger.warn( problem.getMessage()
|
||||
+ ( StringUtils.isNotEmpty( location ) ? " @ " + location : "" ) );
|
||||
}
|
||||
|
||||
problems = true;
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.apache.maven.repository.RepositorySystem;
|
|||
import org.codehaus.plexus.component.annotations.Component;
|
||||
import org.codehaus.plexus.component.annotations.Requirement;
|
||||
|
||||
@Component(role = ProjectDependenciesResolver.class)
|
||||
@Component( role = ProjectDependenciesResolver.class )
|
||||
public class DefaultProjectDependenciesResolver
|
||||
implements ProjectDependenciesResolver
|
||||
{
|
||||
|
@ -97,15 +97,15 @@ public class DefaultProjectDependenciesResolver
|
|||
return resolved;
|
||||
}
|
||||
|
||||
if ( ( scopesToCollect == null || scopesToCollect.isEmpty() ) &&
|
||||
( scopesToResolve == null || scopesToResolve.isEmpty() ) )
|
||||
if ( ( scopesToCollect == null || scopesToCollect.isEmpty() )
|
||||
&& ( scopesToResolve == null || scopesToResolve.isEmpty() ) )
|
||||
{
|
||||
return resolved;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Logic for transitve global exclusions
|
||||
Logic for transitive global exclusions
|
||||
|
||||
List<String> exclusions = new ArrayList<String>();
|
||||
|
||||
|
@ -126,7 +126,8 @@ public class DefaultProjectDependenciesResolver
|
|||
|
||||
if ( ! exclusions.isEmpty() )
|
||||
{
|
||||
filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ new ExcludesArtifactFilter( exclusions ), scopeFilter } ) );
|
||||
filter = new AndArtifactFilter( Arrays.asList( new ArtifactFilter[]{ new ExcludesArtifactFilter( exclusions ),
|
||||
scopeFilter } ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -140,10 +141,10 @@ public class DefaultProjectDependenciesResolver
|
|||
collectionScopeFilter = new CumulativeScopeArtifactFilter( collectionScopeFilter, resolutionScopeFilter );
|
||||
|
||||
ArtifactResolutionRequest request =
|
||||
new ArtifactResolutionRequest().setResolveRoot( false ).setResolveTransitively( true ).setCollectionFilter(
|
||||
collectionScopeFilter ).setResolutionFilter( resolutionScopeFilter ).setLocalRepository(
|
||||
session.getLocalRepository() ).setOffline( session.isOffline() ).setForceUpdate(
|
||||
session.getRequest().isUpdateSnapshots() ).setCache( session.getRepositoryCache() );
|
||||
new ArtifactResolutionRequest().setResolveRoot( false ).setResolveTransitively( true )
|
||||
.setCollectionFilter( collectionScopeFilter ).setResolutionFilter( resolutionScopeFilter )
|
||||
.setLocalRepository( session.getLocalRepository() ).setOffline( session.isOffline() )
|
||||
.setForceUpdate( session.getRequest().isUpdateSnapshots() ).setCache( session.getRepositoryCache() );
|
||||
request.setTransferListener( session.getRequest().getTransferListener() );
|
||||
request.setServers( session.getRequest().getServers() );
|
||||
request.setMirrors( session.getRequest().getMirrors() );
|
||||
|
|
|
@ -1,5 +1,23 @@
|
|||
package org.apache.maven;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue