</description>
<name>repositories</name>
<version>1.0.0</version>
- <association java.generate-add="false"
+ <association java.generate-add="false"
java.generate-remove="false"
java.generate-break="false"
java.generate-create="false">
The list of network proxies to use for outgoing requests.
</description>
</field>
+ <field>
+ <name>legacyArtifactPaths</name>
+ <version>1.0.0+</version>
+ <association>
+ <type>LegacyArtifactPath</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ <description>
+ The list of custom legacy path to artifact.
+ </description>
+ </field>
<field>
<name>repositoryScanning</name>
<version>1.0.0+</version>
}
return map;
}
-
+
public java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> getProxyConnectorAsMap()
{
- java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
+ java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
new java.util.HashMap<String, java.util.List<ProxyConnectorConfiguration>>();
java.util.Iterator<ProxyConnectorConfiguration> it = proxyConnectors.iterator();
}
return proxyConnectorMap;
- }
+ }
public java.util.Map<String, RemoteRepositoryConfiguration> getRemoteRepositoriesAsMap()
{
</codeSegments>
</class>
- <!--
+ <!--
____ _ _
| _ \ ___ _ __ ___ ___(_) |_ ___ _ __ _ _
| |_) / _ \ '_ \ / _ \/ __| | __/ _ \| '__| | | |
</fields>
</class>
- <!--
+ <class>
+ <name>LegacyArtifactPath</name>
+ <version>1.0.0+</version>
+ <fields>
+ <field>
+ <name>path</name>
+ <version>1.0.0+</version>
+ <type>String</type>
+ <required>true</required>
+ <description>
+ The legacy path.
+ </description>
+ </field>
+ <field>
+ <name>artifact</name>
+ <version>1.0.0+</version>
+ <type>String</type>
+ <required>true</required>
+ <description>
+ The artifact reference, as " [groupId] : [artifactId] : [version] : [classifier] : [type] ".
+ </description>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <version>1.0.0+</version>
+ <code><![CDATA[
+ public boolean match( String path )
+ {
+ return path.equals( this.path );
+ }
+
+ public org.apache.maven.archiva.model.ArtifactReference getArtifactReference()
+ {
+ org.apache.maven.archiva.model.ArtifactReference reference = new org.apache.maven.archiva.model.ArtifactReference();
+ String[] parts = artifact.split( ":" );
+ reference.setGroupId( parts[0] );
+ reference.setArtifactId( parts[1] );
+ reference.setVersion( parts[2] );
+ if ( parts[3].length() > 0 )
+ {
+ reference.setClassifier( parts[3] );
+ }
+ reference.setType( parts[4] );
+ return reference;
+ }
+ ]]></code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+
+ <!--
____ _
/ ___|___ _ __ _ __ ___ ___| |_ ___ _ __ ___
| | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __|
<code><![CDATA[
/**
* Obtain a specific policy from the underlying connector.
- *
+ *
* @param policyId the policy id to fetch.
* @param defaultValue the default value for the policy id.
* @return the configured policy value (or default value if not found).
* The order id for UNORDERED
*/
public static final int UNORDERED = 0;
-
+
/**
* The policy key {@link #getPolicies()} for snapshot handling.
- * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy}
+ * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_SNAPSHOTS = "snapshots";
</fields>
</class>
- <!--
+ <!--
____ _
| _ \ _ __ _____ _(_) ___ ___
| |_) | '__/ _ \ \/ / |/ _ \/ __|
</fields>
</class>
- <!--
+ <!--
____ _
/ ___| ___ __ _ _ __ _ __ (_)_ __ __ _
\___ \ / __/ _` | '_ \| '_ \| | '_ \ / _` |
</fields>
</class>
- <!--
- __ _______ ____ _ ____ ____
- \ \ / / ____| __ ) / \ | _ \| _ \
+ <!--
+ __ _______ ____ _ ____ ____
+ \ \ / / ____| __ ) / \ | _ \| _ \
\ \ /\ / /| _| | _ \ / _ \ | |_) | |_) |
- \ V V / | |___| |_) / ___ \| __/| __/
- \_/\_/ |_____|____/_/ \_\_| |_|
-
+ \ V V / | |___| |_) / ___ \| __/| __/
+ \_/\_/ |_____|____/_/ \_\_| |_|
+
-->
<class>
--- /dev/null
+package org.apache.maven.archiva.configuration;\r
+\r
+import junit.framework.TestCase;\r
+\r
+import org.apache.maven.archiva.model.ArtifactReference;\r
+\r
+/*\r
+ * Licensed to the Apache Software Foundation (ASF) under one\r
+ * or more contributor license agreements. See the NOTICE file\r
+ * distributed with this work for additional information\r
+ * regarding copyright ownership. The ASF licenses this file\r
+ * to you under the Apache License, Version 2.0 (the\r
+ * "License"); you may not use this file except in compliance\r
+ * with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing,\r
+ * software distributed under the License is distributed on an\r
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+ * KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations\r
+ * under the License.\r
+ */\r
+\r
+/**\r
+ * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods.\r
+ */\r
+public class LegacyArtifactPathTest\r
+ extends TestCase\r
+{\r
+\r
+ private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath();\r
+\r
+ public void testLegacyArtifactPathWithClassifierResolution()\r
+ {\r
+ legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" );\r
+\r
+ ArtifactReference artifact = legacyArtifactPath.getArtifactReference();\r
+ assertEquals( "groupId", artifact.getGroupId() );\r
+ assertEquals( "artifactId", artifact.getArtifactId() );\r
+ assertEquals( "version", artifact.getVersion() );\r
+ assertEquals( "classifier", artifact.getClassifier() );\r
+ assertEquals( "type", artifact.getType() );\r
+ }\r
+\r
+\r
+ public void testLegacyArtifactPathWithoutClassifierResolution()\r
+ {\r
+ legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" );\r
+\r
+ ArtifactReference artifact = legacyArtifactPath.getArtifactReference();\r
+ assertEquals( "groupId", artifact.getGroupId() );\r
+ assertEquals( "artifactId", artifact.getArtifactId() );\r
+ assertEquals( "version", artifact.getVersion() );\r
+ assertEquals( null, artifact.getClassifier() );\r
+ assertEquals( "type", artifact.getType() );\r
+ }\r
+}\r