import org.apache.archiva.consumers.AbstractMonitoredConsumer;
import org.apache.archiva.consumers.ConsumerException;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.repository.events.RepositoryListener;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.archiva.repository.events.RepositoryListener;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.commons.lang.time.DateUtils;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.archiva.repository.events.RepositoryListener;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
import org.apache.archiva.converter.artifact.ArtifactConversionException;
import org.apache.archiva.converter.artifact.ArtifactConverter;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.content.ManagedDefaultRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.commons.lang.StringUtils;
+import org.apache.archiva.common.utils.VersionUtil;
+
+/**
+ * ArchivaArtifact - Mutable artifact object.
+ *
+ * @version $Id$
+ */
+public class ArchivaArtifact
+{
+ private ArchivaArtifactModel model;
+
+ private ArchivaArtifactPlatformDetails platformDetails;
+
+ private String baseVersion;
+
+ public ArchivaArtifact( String groupId, String artifactId, String version,
+ String classifier, String type, String repositoryId )
+ {
+ if ( empty( groupId ) )
+ {
+ throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty groupId ["
+ + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
+ }
+
+ if ( empty( artifactId ) )
+ {
+ throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty artifactId ["
+ + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
+ }
+
+ if ( empty( version ) )
+ {
+ throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty version ["
+ + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
+ }
+
+ if ( empty( type ) )
+ {
+ throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty type ["
+ + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
+ }
+
+ if ( empty( repositoryId ) )
+ {
+ throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty repositoryId ["
+ + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
+ }
+
+ model = new ArchivaArtifactModel();
+
+ model.setGroupId( groupId );
+ model.setArtifactId( artifactId );
+ model.setVersion( version );
+ model.setClassifier( StringUtils.defaultString( classifier ) );
+ model.setType( type );
+ model.setSnapshot( VersionUtil.isSnapshot( version ) );
+ model.setRepositoryId(repositoryId);
+
+ this.baseVersion = VersionUtil.getBaseVersion( version );
+ }
+
+ public ArchivaArtifact( ArchivaArtifactModel artifactModel )
+ {
+ this.model = artifactModel;
+ model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
+ this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
+ }
+
+ public ArchivaArtifact( ArtifactReference ref, String repositoryId )
+ {
+ this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType(), repositoryId );
+ }
+
+ public ArchivaArtifactModel getModel()
+ {
+ return model;
+ }
+
+ public String getGroupId()
+ {
+ return model.getGroupId();
+ }
+
+ public String getArtifactId()
+ {
+ return model.getArtifactId();
+ }
+
+ public String getVersion()
+ {
+ return model.getVersion();
+ }
+
+ public String getBaseVersion()
+ {
+ return baseVersion;
+ }
+
+ public boolean isSnapshot()
+ {
+ return model.isSnapshot();
+ }
+
+ public String getClassifier()
+ {
+ return model.getClassifier();
+ }
+
+ public String getType()
+ {
+ return model.getType();
+ }
+
+ public boolean hasClassifier()
+ {
+ return StringUtils.isNotEmpty( model.getClassifier() );
+ }
+
+ public String getRepositoryId()
+ {
+ return model.getRepositoryId();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int PRIME = 31;
+ int result = 1;
+ if ( model != null )
+ {
+ result = PRIME * result + ( ( model.getGroupId() == null ) ? 0 : model.getGroupId().hashCode() );
+ result = PRIME * result + ( ( model.getArtifactId() == null ) ? 0 : model.getArtifactId().hashCode() );
+ result = PRIME * result + ( ( model.getVersion() == null ) ? 0 : model.getVersion().hashCode() );
+ result = PRIME * result + ( ( model.getClassifier() == null ) ? 0 : model.getClassifier().hashCode() );
+ result = PRIME * result + ( ( model.getType() == null ) ? 0 : model.getType().hashCode() );
+ }
+ return result;
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ if ( this == obj )
+ {
+ return true;
+ }
+
+ if ( obj == null )
+ {
+ return false;
+ }
+
+ if ( getClass() != obj.getClass() )
+ {
+ return false;
+ }
+
+ final ArchivaArtifact other = (ArchivaArtifact) obj;
+
+ if ( model == null )
+ {
+ if ( other.model != null )
+ {
+ return false;
+ }
+ }
+ if ( !model.equals( other.model ) )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuffer sb = new StringBuffer();
+ if ( model.getGroupId() != null )
+ {
+ sb.append( model.getGroupId() );
+ sb.append( ":" );
+ }
+ appendArtifactTypeClassifierString( sb );
+ sb.append( ":" );
+ if ( model.getVersion() != null )
+ {
+ sb.append( model.getVersion() );
+ }
+
+ return sb.toString();
+ }
+
+ private void appendArtifactTypeClassifierString( StringBuffer sb )
+ {
+ sb.append( model.getArtifactId() );
+ sb.append( ":" );
+ sb.append( getType() );
+ if ( hasClassifier() )
+ {
+ sb.append( ":" );
+ sb.append( getClassifier() );
+ }
+ }
+
+ private boolean empty( String value )
+ {
+ return ( value == null ) || ( value.trim().length() < 1 );
+ }
+
+ public ArchivaArtifactPlatformDetails getPlatformDetails()
+ {
+ return platformDetails;
+ }
+
+ public void setPlatformDetails( ArchivaArtifactPlatformDetails platformDetails )
+ {
+ this.platformDetails = platformDetails;
+ }
+}
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.
+ */
+
+/**
+ * A tag for objects that are considered ArchivaArtifactPlatformDetails.
+ *
+ * @version $Id$
+ */
+public interface ArchivaArtifactPlatformDetails
+{
+ public String getPlatform();
+}
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * Utility methods for cloning various Archiva Model objects.
+ *
+ * @version $Id$
+ */
+public class ArchivaModelCloner
+{
+
+ public static ArtifactReference clone( ArtifactReference artifactReference )
+ {
+ if ( artifactReference == null )
+ {
+ return null;
+ }
+
+ ArtifactReference cloned = new ArtifactReference();
+
+ cloned.setGroupId( artifactReference.getGroupId() );
+ cloned.setArtifactId( artifactReference.getArtifactId() );
+ cloned.setVersion( artifactReference.getVersion() );
+ cloned.setClassifier( artifactReference.getClassifier() );
+ cloned.setType( artifactReference.getType() );
+
+ return cloned;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Properties clone( Properties properties )
+ {
+ if ( properties == null )
+ {
+ return null;
+ }
+
+ Properties cloned = new Properties();
+
+ Enumeration<String> keys = (Enumeration<String>) properties.propertyNames();
+ while ( keys.hasMoreElements() )
+ {
+ String key = (String) keys.nextElement();
+ String value = properties.getProperty( key );
+ cloned.setProperty( key, value );
+ }
+
+ return cloned;
+ }
+
+ public static SnapshotVersion clone( SnapshotVersion snapshotVersion )
+ {
+ if ( snapshotVersion == null )
+ {
+ return null;
+ }
+
+ SnapshotVersion cloned = new SnapshotVersion();
+
+ cloned.setTimestamp( snapshotVersion.getTimestamp() );
+ cloned.setBuildNumber( snapshotVersion.getBuildNumber() );
+
+ return cloned;
+ }
+
+ public static VersionedReference clone( VersionedReference versionedReference )
+ {
+ if ( versionedReference == null )
+ {
+ return null;
+ }
+
+ VersionedReference cloned = new VersionedReference();
+
+ cloned.setGroupId( versionedReference.getGroupId() );
+ cloned.setArtifactId( versionedReference.getArtifactId() );
+ cloned.setVersion( versionedReference.getVersion() );
+
+ return cloned;
+ }
+
+ public static List<ArtifactReference> cloneArtifactReferences( List<ArtifactReference> artifactReferenceList )
+ {
+ if ( artifactReferenceList == null )
+ {
+ return null;
+ }
+
+ List<ArtifactReference> ret = new ArrayList<ArtifactReference>();
+
+ for ( ArtifactReference ref : artifactReferenceList )
+ {
+ ret.add( clone( ref ) );
+ }
+
+ return ret;
+ }
+
+ private static List<String> cloneSimpleStringList( List<String> simple )
+ {
+ if ( simple == null )
+ {
+ return null;
+ }
+
+ List<String> ret = new ArrayList<String>();
+
+ for ( String txt : simple )
+ {
+ ret.add( txt );
+ }
+
+ return ret;
+ }
+
+ public static List<String> cloneAvailableVersions( List<String> availableVersions )
+ {
+ return cloneSimpleStringList( availableVersions );
+ }
+}
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.
+ */
+
+/**
+ * Tag for identifying a Compound Key
+ *
+ * @version $Id$
+ */
+public interface CompoundKey
+{
+ public String toString();
+}
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.commons.lang.StringUtils;
+
+/**
+ * Keys - utility methods for converting common objects into string keys.
+ *
+ * @version $Id$
+ */
+public class Keys
+{
+ public static String toKey( String groupId, String artifactId, String version, String classifier, String type )
+ {
+ StringBuffer key = new StringBuffer();
+
+ key.append( groupId ).append( ":" );
+ key.append( artifactId ).append( ":" );
+ key.append( version ).append( ":" );
+ key.append( StringUtils.defaultString( classifier ) ).append( ":" );
+ key.append( type );
+
+ return key.toString();
+ }
+
+ public static String toKey( ArtifactReference ref )
+ {
+ return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() );
+ }
+
+ public static String toKey( ProjectReference ref )
+ {
+ StringBuffer key = new StringBuffer();
+
+ key.append( ref.getGroupId() ).append( ":" );
+ key.append( ref.getArtifactId() );
+
+ return key.toString();
+ }
+
+ public static String toKey( String groupId, String artifactId, String version )
+ {
+ StringBuffer key = new StringBuffer();
+
+ key.append( groupId ).append( ":" );
+ key.append( artifactId ).append( ":" );
+ key.append( version );
+
+ return key.toString();
+ }
+
+ public static String toKey( VersionedReference ref )
+ {
+ return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion() );
+ }
+}
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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.
+ */
+
+/**
+ * RepositoryURL - Mutable (and protocol forgiving) URL object.
+ *
+ * @version $Id$
+ */
+public class RepositoryURL
+{
+ private String url;
+
+ private String protocol;
+
+ private String host;
+
+ private String port;
+
+ private String username;
+
+ private String password;
+
+ private String path;
+
+ public RepositoryURL( String url )
+ {
+ this.url = url;
+
+ // .\ Parse the URL \.____________________________________________
+
+ int pos;
+
+ pos = url.indexOf( ":/" );
+ if ( pos == ( -1 ) )
+ {
+ throw new IllegalArgumentException( "Invalid URL, unable to parse protocol:// from " + url );
+ }
+
+ protocol = url.substring( 0, pos );
+
+ // Determine the post protocol position.
+ int postProtocolPos = protocol.length() + 1;
+ while ( url.charAt( postProtocolPos ) == '/' )
+ {
+ postProtocolPos++;
+ }
+
+ // Handle special case with file protocol (which has no host, port, username, or password)
+ if ( "file".equals( protocol ) )
+ {
+ path = "/" + url.substring( postProtocolPos );
+
+ return;
+ }
+
+ // attempt to find the start of the 'path'
+ pos = url.indexOf( "/", postProtocolPos );
+
+ // no path specified - ex "http://localhost"
+ if ( pos == ( -1 ) )
+ {
+ // set pos to end of string. (needed for 'middle section')
+ pos = url.length();
+ // default path
+ path = "/";
+ }
+ else
+ {
+ // get actual path.
+ path = url.substring( pos );
+ }
+
+ // get the middle section ( username : password @ hostname : port )
+ String middle = url.substring( postProtocolPos, pos );
+
+ pos = middle.indexOf( '@' );
+
+ // we have an authentication section.
+ if ( pos > 0 )
+ {
+ String authentication = middle.substring( 0, pos );
+ middle = middle.substring( pos + 1 ); // lop off authentication for host:port search
+
+ pos = authentication.indexOf( ':' );
+
+ // we have a password.
+ if ( pos > 0 )
+ {
+ username = authentication.substring( 0, pos );
+ password = authentication.substring( pos + 1 );
+ }
+ else
+ {
+ username = authentication;
+ }
+ }
+
+ pos = middle.indexOf( ':' );
+
+ // we have a defined port
+ if ( pos > 0 )
+ {
+ host = middle.substring( 0, pos );
+ port = middle.substring( pos + 1 );
+ }
+ else
+ {
+ host = middle;
+ }
+ }
+
+ public String toString()
+ {
+ return url;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public String getHost()
+ {
+ return host;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public String getPort()
+ {
+ return port;
+ }
+
+ public String getProtocol()
+ {
+ return protocol;
+ }
+
+ public String getUrl()
+ {
+ return url;
+ }
+}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.commons.lang.StringUtils;
-import org.apache.archiva.common.utils.VersionUtil;
-
-/**
- * ArchivaArtifact - Mutable artifact object.
- *
- * @version $Id$
- */
-public class ArchivaArtifact
-{
- private ArchivaArtifactModel model;
-
- private ArchivaArtifactPlatformDetails platformDetails;
-
- private String baseVersion;
-
- public ArchivaArtifact( String groupId, String artifactId, String version,
- String classifier, String type, String repositoryId )
- {
- if ( empty( groupId ) )
- {
- throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty groupId ["
- + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
- }
-
- if ( empty( artifactId ) )
- {
- throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty artifactId ["
- + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
- }
-
- if ( empty( version ) )
- {
- throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty version ["
- + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
- }
-
- if ( empty( type ) )
- {
- throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty type ["
- + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
- }
-
- if ( empty( repositoryId ) )
- {
- throw new IllegalArgumentException( "Unable to create ArchivaArtifact with empty repositoryId ["
- + Keys.toKey( groupId, artifactId, version, classifier, type ) + "]" );
- }
-
- model = new ArchivaArtifactModel();
-
- model.setGroupId( groupId );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- model.setClassifier( StringUtils.defaultString( classifier ) );
- model.setType( type );
- model.setSnapshot( VersionUtil.isSnapshot( version ) );
- model.setRepositoryId(repositoryId);
-
- this.baseVersion = VersionUtil.getBaseVersion( version );
- }
-
- public ArchivaArtifact( ArchivaArtifactModel artifactModel )
- {
- this.model = artifactModel;
- model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
- this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
- }
-
- public ArchivaArtifact( ArtifactReference ref, String repositoryId )
- {
- this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType(), repositoryId );
- }
-
- public ArchivaArtifactModel getModel()
- {
- return model;
- }
-
- public String getGroupId()
- {
- return model.getGroupId();
- }
-
- public String getArtifactId()
- {
- return model.getArtifactId();
- }
-
- public String getVersion()
- {
- return model.getVersion();
- }
-
- public String getBaseVersion()
- {
- return baseVersion;
- }
-
- public boolean isSnapshot()
- {
- return model.isSnapshot();
- }
-
- public String getClassifier()
- {
- return model.getClassifier();
- }
-
- public String getType()
- {
- return model.getType();
- }
-
- public boolean hasClassifier()
- {
- return StringUtils.isNotEmpty( model.getClassifier() );
- }
-
- public String getRepositoryId()
- {
- return model.getRepositoryId();
- }
-
- @Override
- public int hashCode()
- {
- final int PRIME = 31;
- int result = 1;
- if ( model != null )
- {
- result = PRIME * result + ( ( model.getGroupId() == null ) ? 0 : model.getGroupId().hashCode() );
- result = PRIME * result + ( ( model.getArtifactId() == null ) ? 0 : model.getArtifactId().hashCode() );
- result = PRIME * result + ( ( model.getVersion() == null ) ? 0 : model.getVersion().hashCode() );
- result = PRIME * result + ( ( model.getClassifier() == null ) ? 0 : model.getClassifier().hashCode() );
- result = PRIME * result + ( ( model.getType() == null ) ? 0 : model.getType().hashCode() );
- }
- return result;
- }
-
- @Override
- public boolean equals( Object obj )
- {
- if ( this == obj )
- {
- return true;
- }
-
- if ( obj == null )
- {
- return false;
- }
-
- if ( getClass() != obj.getClass() )
- {
- return false;
- }
-
- final ArchivaArtifact other = (ArchivaArtifact) obj;
-
- if ( model == null )
- {
- if ( other.model != null )
- {
- return false;
- }
- }
- if ( !model.equals( other.model ) )
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- if ( model.getGroupId() != null )
- {
- sb.append( model.getGroupId() );
- sb.append( ":" );
- }
- appendArtifactTypeClassifierString( sb );
- sb.append( ":" );
- if ( model.getVersion() != null )
- {
- sb.append( model.getVersion() );
- }
-
- return sb.toString();
- }
-
- private void appendArtifactTypeClassifierString( StringBuffer sb )
- {
- sb.append( model.getArtifactId() );
- sb.append( ":" );
- sb.append( getType() );
- if ( hasClassifier() )
- {
- sb.append( ":" );
- sb.append( getClassifier() );
- }
- }
-
- private boolean empty( String value )
- {
- return ( value == null ) || ( value.trim().length() < 1 );
- }
-
- public ArchivaArtifactPlatformDetails getPlatformDetails()
- {
- return platformDetails;
- }
-
- public void setPlatformDetails( ArchivaArtifactPlatformDetails platformDetails )
- {
- this.platformDetails = platformDetails;
- }
-}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.
- */
-
-/**
- * A tag for objects that are considered ArchivaArtifactPlatformDetails.
- *
- * @version $Id$
- */
-public interface ArchivaArtifactPlatformDetails
-{
- public String getPlatform();
-}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * Utility methods for cloning various Archiva Model objects.
- *
- * @version $Id$
- */
-public class ArchivaModelCloner
-{
-
- public static ArtifactReference clone( ArtifactReference artifactReference )
- {
- if ( artifactReference == null )
- {
- return null;
- }
-
- ArtifactReference cloned = new ArtifactReference();
-
- cloned.setGroupId( artifactReference.getGroupId() );
- cloned.setArtifactId( artifactReference.getArtifactId() );
- cloned.setVersion( artifactReference.getVersion() );
- cloned.setClassifier( artifactReference.getClassifier() );
- cloned.setType( artifactReference.getType() );
-
- return cloned;
- }
-
- @SuppressWarnings("unchecked")
- public static Properties clone( Properties properties )
- {
- if ( properties == null )
- {
- return null;
- }
-
- Properties cloned = new Properties();
-
- Enumeration<String> keys = (Enumeration<String>) properties.propertyNames();
- while ( keys.hasMoreElements() )
- {
- String key = (String) keys.nextElement();
- String value = properties.getProperty( key );
- cloned.setProperty( key, value );
- }
-
- return cloned;
- }
-
- public static SnapshotVersion clone( SnapshotVersion snapshotVersion )
- {
- if ( snapshotVersion == null )
- {
- return null;
- }
-
- SnapshotVersion cloned = new SnapshotVersion();
-
- cloned.setTimestamp( snapshotVersion.getTimestamp() );
- cloned.setBuildNumber( snapshotVersion.getBuildNumber() );
-
- return cloned;
- }
-
- public static VersionedReference clone( VersionedReference versionedReference )
- {
- if ( versionedReference == null )
- {
- return null;
- }
-
- VersionedReference cloned = new VersionedReference();
-
- cloned.setGroupId( versionedReference.getGroupId() );
- cloned.setArtifactId( versionedReference.getArtifactId() );
- cloned.setVersion( versionedReference.getVersion() );
-
- return cloned;
- }
-
- public static List<ArtifactReference> cloneArtifactReferences( List<ArtifactReference> artifactReferenceList )
- {
- if ( artifactReferenceList == null )
- {
- return null;
- }
-
- List<ArtifactReference> ret = new ArrayList<ArtifactReference>();
-
- for ( ArtifactReference ref : artifactReferenceList )
- {
- ret.add( clone( ref ) );
- }
-
- return ret;
- }
-
- private static List<String> cloneSimpleStringList( List<String> simple )
- {
- if ( simple == null )
- {
- return null;
- }
-
- List<String> ret = new ArrayList<String>();
-
- for ( String txt : simple )
- {
- ret.add( txt );
- }
-
- return ret;
- }
-
- public static List<String> cloneAvailableVersions( List<String> availableVersions )
- {
- return cloneSimpleStringList( availableVersions );
- }
-}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.
- */
-
-/**
- * Tag for identifying a Compound Key
- *
- * @version $Id$
- */
-public interface CompoundKey
-{
- public String toString();
-}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.commons.lang.StringUtils;
-
-/**
- * Keys - utility methods for converting common objects into string keys.
- *
- * @version $Id$
- */
-public class Keys
-{
- public static String toKey( String groupId, String artifactId, String version, String classifier, String type )
- {
- StringBuffer key = new StringBuffer();
-
- key.append( groupId ).append( ":" );
- key.append( artifactId ).append( ":" );
- key.append( version ).append( ":" );
- key.append( StringUtils.defaultString( classifier ) ).append( ":" );
- key.append( type );
-
- return key.toString();
- }
-
- public static String toKey( ArtifactReference ref )
- {
- return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() );
- }
-
- public static String toKey( ProjectReference ref )
- {
- StringBuffer key = new StringBuffer();
-
- key.append( ref.getGroupId() ).append( ":" );
- key.append( ref.getArtifactId() );
-
- return key.toString();
- }
-
- public static String toKey( String groupId, String artifactId, String version )
- {
- StringBuffer key = new StringBuffer();
-
- key.append( groupId ).append( ":" );
- key.append( artifactId ).append( ":" );
- key.append( version );
-
- return key.toString();
- }
-
- public static String toKey( VersionedReference ref )
- {
- return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion() );
- }
-}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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.
- */
-
-/**
- * RepositoryURL - Mutable (and protocol forgiving) URL object.
- *
- * @version $Id$
- */
-public class RepositoryURL
-{
- private String url;
-
- private String protocol;
-
- private String host;
-
- private String port;
-
- private String username;
-
- private String password;
-
- private String path;
-
- public RepositoryURL( String url )
- {
- this.url = url;
-
- // .\ Parse the URL \.____________________________________________
-
- int pos;
-
- pos = url.indexOf( ":/" );
- if ( pos == ( -1 ) )
- {
- throw new IllegalArgumentException( "Invalid URL, unable to parse protocol:// from " + url );
- }
-
- protocol = url.substring( 0, pos );
-
- // Determine the post protocol position.
- int postProtocolPos = protocol.length() + 1;
- while ( url.charAt( postProtocolPos ) == '/' )
- {
- postProtocolPos++;
- }
-
- // Handle special case with file protocol (which has no host, port, username, or password)
- if ( "file".equals( protocol ) )
- {
- path = "/" + url.substring( postProtocolPos );
-
- return;
- }
-
- // attempt to find the start of the 'path'
- pos = url.indexOf( "/", postProtocolPos );
-
- // no path specified - ex "http://localhost"
- if ( pos == ( -1 ) )
- {
- // set pos to end of string. (needed for 'middle section')
- pos = url.length();
- // default path
- path = "/";
- }
- else
- {
- // get actual path.
- path = url.substring( pos );
- }
-
- // get the middle section ( username : password @ hostname : port )
- String middle = url.substring( postProtocolPos, pos );
-
- pos = middle.indexOf( '@' );
-
- // we have an authentication section.
- if ( pos > 0 )
- {
- String authentication = middle.substring( 0, pos );
- middle = middle.substring( pos + 1 ); // lop off authentication for host:port search
-
- pos = authentication.indexOf( ':' );
-
- // we have a password.
- if ( pos > 0 )
- {
- username = authentication.substring( 0, pos );
- password = authentication.substring( pos + 1 );
- }
- else
- {
- username = authentication;
- }
- }
-
- pos = middle.indexOf( ':' );
-
- // we have a defined port
- if ( pos > 0 )
- {
- host = middle.substring( 0, pos );
- port = middle.substring( pos + 1 );
- }
- else
- {
- host = middle;
- }
- }
-
- public String toString()
- {
- return url;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public String getHost()
- {
- return host;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public String getPort()
- {
- return port;
- }
-
- public String getProtocol()
- {
- return protocol;
- }
-
- public String getUrl()
- {
- return url;
- }
-}
<defaults>
<default>
<key>package</key>
- <value>org.apache.maven.archiva.model</value>
+ <value>org.apache.archiva.model</value>
</default>
</defaults>
--- /dev/null
+package org.apache.archiva.model;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * RepositoryURLTest
+ *
+ * @version $Id$
+ */
+public class RepositoryURLTest
+ extends TestCase
+{
+ private static final String NO_HOST = null;
+
+ private static final String NO_PORT = null;
+
+ private static final String NO_USER = null;
+
+ private static final String NO_PASS = null;
+
+ private void assertURL( String url, String expectedProtocol, String expectedHost, String expectedPort,
+ String expectedPath, String expectedUsername, String expectedPassword )
+ {
+ RepositoryURL rurl = new RepositoryURL( url );
+ assertEquals( "Protocol", expectedProtocol, rurl.getProtocol() );
+ assertEquals( "Host", expectedHost, rurl.getHost() );
+ assertEquals( "Port", expectedPort, rurl.getPort() );
+ assertEquals( "Path", expectedPath, rurl.getPath() );
+ assertEquals( "Username", expectedUsername, rurl.getUsername() );
+ assertEquals( "Password", expectedPassword, rurl.getPassword() );
+ }
+
+ public void testFileUrlNormal()
+ {
+ assertURL( "file:///home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/",
+ NO_USER, NO_PASS );
+ }
+
+ public void testFileUrlShort()
+ {
+ assertURL( "file:/home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/",
+ NO_USER, NO_PASS );
+ }
+
+ public void testHttpUrlPathless()
+ {
+ assertURL( "http://machine", "http", "machine", NO_PORT, "/", NO_USER, NO_PASS );
+ }
+
+ public void testHttpUrlWithPort()
+ {
+ assertURL( "http://machine:8080/", "http", "machine", "8080", "/", NO_USER, NO_PASS );
+ }
+
+ public void testHttpUrlWithUsernamePassword()
+ {
+ assertURL( "http://user:pass@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", "pass" );
+ }
+
+ public void testHttpUrlWithUsernameNoPassword()
+ {
+ assertURL( "http://user@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", NO_PASS );
+ }
+
+ public void testHttpUrlWithUsernamePasswordAndPort()
+ {
+ assertURL( "http://user:pass@machine:9090/secured/", "http", "machine", "9090", "/secured/", "user", "pass" );
+ }
+
+ public void testBogusWithPath()
+ {
+ // This should not fail. The intent of RepositoryURL is to have it support oddball protocols that
+ // are used by maven-scm and maven-wagon (unlike java.net.URL)
+ assertURL( "bogus://a.machine.name.com/path/to/resource/file.txt", "bogus", "a.machine.name.com", NO_PORT,
+ "/path/to/resource/file.txt", NO_USER, NO_PASS );
+ }
+}
+++ /dev/null
-package org.apache.maven.archiva.model;
-
-/*
- * 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 junit.framework.TestCase;
-
-/**
- * RepositoryURLTest
- *
- * @version $Id$
- */
-public class RepositoryURLTest
- extends TestCase
-{
- private static final String NO_HOST = null;
-
- private static final String NO_PORT = null;
-
- private static final String NO_USER = null;
-
- private static final String NO_PASS = null;
-
- private void assertURL( String url, String expectedProtocol, String expectedHost, String expectedPort,
- String expectedPath, String expectedUsername, String expectedPassword )
- {
- RepositoryURL rurl = new RepositoryURL( url );
- assertEquals( "Protocol", expectedProtocol, rurl.getProtocol() );
- assertEquals( "Host", expectedHost, rurl.getHost() );
- assertEquals( "Port", expectedPort, rurl.getPort() );
- assertEquals( "Path", expectedPath, rurl.getPath() );
- assertEquals( "Username", expectedUsername, rurl.getUsername() );
- assertEquals( "Password", expectedPassword, rurl.getPassword() );
- }
-
- public void testFileUrlNormal()
- {
- assertURL( "file:///home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/",
- NO_USER, NO_PASS );
- }
-
- public void testFileUrlShort()
- {
- assertURL( "file:/home/joakim/code/test/this/", "file", NO_HOST, NO_PORT, "/home/joakim/code/test/this/",
- NO_USER, NO_PASS );
- }
-
- public void testHttpUrlPathless()
- {
- assertURL( "http://machine", "http", "machine", NO_PORT, "/", NO_USER, NO_PASS );
- }
-
- public void testHttpUrlWithPort()
- {
- assertURL( "http://machine:8080/", "http", "machine", "8080", "/", NO_USER, NO_PASS );
- }
-
- public void testHttpUrlWithUsernamePassword()
- {
- assertURL( "http://user:pass@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", "pass" );
- }
-
- public void testHttpUrlWithUsernameNoPassword()
- {
- assertURL( "http://user@machine/secured/", "http", "machine", NO_PORT, "/secured/", "user", NO_PASS );
- }
-
- public void testHttpUrlWithUsernamePasswordAndPort()
- {
- assertURL( "http://user:pass@machine:9090/secured/", "http", "machine", "9090", "/secured/", "user", "pass" );
- }
-
- public void testBogusWithPath()
- {
- // This should not fail. The intent of RepositoryURL is to have it support oddball protocols that
- // are used by maven-scm and maven-wagon (unlike java.net.URL)
- assertURL( "bogus://a.machine.name.com/path/to/resource/file.txt", "bogus", "a.machine.name.com", NO_PORT,
- "/path/to/resource/file.txt", NO_USER, NO_PASS );
- }
-}
import org.apache.maven.archiva.configuration.ConfigurationNames;
import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.Keys;
-import org.apache.maven.archiva.model.RepositoryURL;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.Keys;
+import org.apache.archiva.model.RepositoryURL;
import org.apache.archiva.policies.DownloadErrorPolicy;
import org.apache.archiva.policies.DownloadPolicy;
import org.apache.archiva.policies.PolicyConfigurationException;
* under the License.
*/
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.ProxyDownloadException;
import org.apache.archiva.repository.ManagedRepositoryContent;
*/
import org.apache.archiva.common.utils.PathUtil;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
*/
import org.apache.commons.io.FileUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.PropagateErrorsDownloadPolicy;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
* under the License.
*/
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.VersionUtil;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.Plugin;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.SnapshotVersion;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
* under the License.
*/
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
*/
import org.apache.archiva.admin.model.beans.ManagedRepository;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.layout.LayoutException;
import java.io.File;
*/
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.RepositoryURL;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.RepositoryURL;
import org.apache.archiva.repository.layout.LayoutException;
/**
import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.layout.LayoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.layout.LayoutException;
import javax.inject.Inject;
import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator;
import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.layout.LayoutException;
import org.springframework.stereotype.Service;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.LegacyArtifactPath;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.layout.LayoutException;
import java.util.Collection;
import org.apache.commons.io.FileUtils;
import org.apache.archiva.common.utils.PathUtil;
import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.PathUtil;
import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaArtifact;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
* under the License.
*/
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.layout.LayoutException;
/**
*/
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.RepositoryURL;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.RepositoryURL;
import org.apache.archiva.repository.RemoteRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.springframework.context.annotation.Scope;
*/
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.RepositoryURL;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.RepositoryURL;
import org.apache.archiva.repository.RemoteRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.springframework.context.annotation.Scope;
*/
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.layout.LayoutException;
import org.apache.archiva.repository.metadata.MetadataTools;
import org.apache.maven.archiva.configuration.ConfigurationNames;
import org.apache.maven.archiva.configuration.FileTypes;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.Plugin;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.SnapshotVersion;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RemoteRepositoryContent;
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArchivaModelCloner;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.Plugin;
-import org.apache.maven.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.ArchivaModelCloner;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.SnapshotVersion;
/**
* RepositoryMetadataMerge
import java.util.Date;
import org.apache.commons.lang.math.NumberUtils;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.Plugin;
-import org.apache.maven.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
+import org.apache.archiva.model.SnapshotVersion;
import org.apache.archiva.xml.XMLException;
import org.apache.archiva.xml.XMLReader;
import org.dom4j.Element;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.Plugin;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.Plugin;
import org.apache.archiva.xml.XMLException;
import org.apache.archiva.xml.XMLWriter;
import org.dom4j.Document;
*/
-import org.apache.maven.archiva.model.RepositoryURL;
+import org.apache.archiva.model.RepositoryURL;
import java.net.MalformedURLException;
*/
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
* under the License.
*/
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
*/
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Test;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.LegacyArtifactPath;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Before;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.FileType;
import org.apache.maven.archiva.configuration.FileTypes;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Before;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.common.utils.VersionComparator;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Before;
*/
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.RemoteRepositoryContent;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Before;
*/
import org.apache.archiva.admin.model.beans.RemoteRepository;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.RemoteRepositoryContent;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.junit.Before;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.FileUtil;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
import org.apache.maven.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.repository.layout.LayoutException;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.model.ProjectReference;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ProjectReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.policies.CachedFailuresPolicy;
import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
*/
import junit.framework.TestCase;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import junit.framework.TestCase;
import org.apache.commons.io.FileUtils;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.custommonkey.xmlunit.XMLAssert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
import org.codehaus.plexus.util.FileUtils;
import org.junit.After;
import org.apache.archiva.consumers.AbstractMonitoredConsumer;
import org.apache.archiva.consumers.ConsumerException;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.dependency.tree.maven2.DependencyTreeBuilder;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.ArchivaException;
-import org.apache.maven.archiva.model.Keys;
+import org.apache.archiva.model.Keys;
import org.apache.archiva.security.ArchivaXworkUser;
import org.apache.archiva.security.UserRepositories;
import org.apache.maven.artifact.Artifact;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
import org.apache.archiva.reports.RepositoryProblemFacet;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.VersionComparator;
import org.apache.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.model.SnapshotVersion;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.admin.model.admin.ArchivaAdministration;
import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.web.action.AbstractActionSupport;
import org.springframework.context.annotation.Scope;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.common.utils.FileUtil;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.SnapshotVersion;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.SnapshotVersion;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.RepositoryNotFoundException;
import org.apache.archiva.common.utils.VersionUtil;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.policies.ProxyDownloadException;
import org.apache.archiva.proxy.RepositoryProxyConnectors;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.apache.archiva.repository.metadata.RepositoryMetadataReader;
import org.junit.After;
import org.junit.Before;
import org.apache.commons.lang.StringUtils;
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.archiva.model.VersionedReference;
import org.apache.archiva.repository.ContentNotFoundException;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration;
import org.apache.archiva.consumers.InvalidRepositoryContentConsumer;
import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.archiva.model.ArtifactReference;
import org.apache.archiva.repository.RepositoryContentFactory;
import org.apache.archiva.repository.content.ManagedDefaultRepositoryContent;
import org.apache.archiva.repository.content.ManagedLegacyRepositoryContent;
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
import org.apache.maven.archiva.configuration.Configuration;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArchivaRepositoryMetadata;
import org.apache.archiva.repository.RepositoryException;
import org.apache.archiva.repository.metadata.RepositoryMetadataException;
import org.apache.archiva.repository.metadata.RepositoryMetadataReader;